/** * Converts this instance into a DTO, ready for wire transmission. * * @since 2.7.0 */ public IndexBrowserTreeNodeDTO toDTO() { List<IndexBrowserTreeNodeDTO> dtoChildren = null; final List<TreeNode> children = getChildren(); if (children != null && !children.isEmpty()) { dtoChildren = Lists.newArrayList(); for (TreeNode childNode : children) { if (childNode instanceof IndexBrowserTreeNode) { dtoChildren.add(((IndexBrowserTreeNode) childNode).toDTO()); } } } return new IndexBrowserTreeNodeDTO(getType().name(), isLeaf(), getNodeName(), getPath(), dtoChildren, getGroupId(), getArtifactId(), getVersion(), getRepositoryId(), isLocallyAvailable(), getArtifactTimestamp(), getArtifactSha1Checksum(), getArtifactMd5Checksum(), getInitiatorUserId(), getInitiatorIpAddress(), getArtifactOriginReason(), getArtifactOriginUrl(), classifier, extension, packaging, artifactUri, pomUri); } }
/** * Find a TreeNode based upon a path and Type check. * * @return TreeNode */ public TreeNode findChildByPath( String path, Type type ) throws IOException { for ( TreeNode child : getChildren() ) { if ( path.equals( child.getPath() ) && type.equals( child.getType() ) ) { return child; } } return null; } }
/** * Find a TreeNode based upon a path and Type check. * * @return TreeNode */ public TreeNode findChildByPath( String path, Type type ) throws IOException { for ( TreeNode child : getChildren() ) { if ( path.equals( child.getPath() ) && type.equals( child.getType() ) ) { return child; } } return null; } }
/** * Find a TreeNode based upon a path and Type check. * * @return TreeNode */ public TreeNode findChildByPath( String path, Type type ) throws IOException { for ( TreeNode child : getChildren() ) { if ( path.equals( child.getPath() ) && type.equals( child.getType() ) ) { return child; } } return null; } }
/** * Set the type of node. * * @param Type */ public void setType( Type type ) { this.type = type.name(); }
/** * Get the type of node. * * @return Type */ public Type getType() { return Type.valueOf( type ); }
/** * Set the type of node. * * @param Type */ public void setType( Type type ) { this.type = type.name(); }
/** * Set the type of node. * * @param Type */ public void setType( Type type ) { this.type = type.name(); }
/** * Get the type of node. * * @return Type */ public Type getType() { return Type.valueOf( type ); }
/** * Get the type of node. * * @return Type */ public Type getType() { return Type.valueOf( type ); }