yangxk1 commented on code in PR #743: URL: https://github.com/apache/incubator-graphar/pull/743#discussion_r2328770525
########## maven-projects/info/src/main/java/org/apache/graphar/info/EdgeInfo.java: ########## @@ -51,6 +53,192 @@ public class EdgeInfo { private final PropertyGroups propertyGroups; private final VersionInfo version; + public static EdgeInfoBuilder builder(){ + return new EdgeInfoBuilder(); + } + + public static final class EdgeInfoBuilder { + private EdgeTriplet edgeTriplet; + private long chunkSize; + private long srcChunkSize; + private long dstChunkSize; + private boolean directed; + private String prefix; + private Map<AdjListType, AdjacentList> adjacentLists; + private PropertyGroups propertyGroups; + private VersionInfo version; + + private List<AdjacentList> adjacentListsAsListTemp; + private List<PropertyGroup> propertyGroupsAsListTemp; + + private String srcType; + private String edgeType; + private String dstType; + + + private EdgeInfoBuilder() {} + + + public EdgeInfoBuilder srcType(String srcType) { + this.srcType = srcType; + return this; + } + + public EdgeInfoBuilder edgeType(String edgeType) { + this.edgeType = edgeType; + return this; + } + public EdgeInfoBuilder dstType(String dstType) { + this.dstType = dstType; + return this; + } + + public EdgeInfoBuilder edgeTriplet(String srcType, String edgeType, String dstType) { + this.edgeTriplet = new EdgeTriplet(srcType, edgeType, dstType); + return this; + } + + + private EdgeInfoBuilder edgeTriplet(EdgeTriplet edgeTriplet) { + this.edgeTriplet = edgeTriplet; + return this; + } + + public EdgeInfoBuilder chunkSize(long chunkSize) { + this.chunkSize = chunkSize; + return this; + } + + public EdgeInfoBuilder srcChunkSize(long srcChunkSize) { + this.srcChunkSize = srcChunkSize; + return this; + } + + public EdgeInfoBuilder dstChunkSize(long dstChunkSize) { + this.dstChunkSize = dstChunkSize; + return this; + } + + public EdgeInfoBuilder directed(boolean directed) { + this.directed = directed; + return this; + } + + public EdgeInfoBuilder prefix(String prefix) { + this.prefix = prefix; + return this; + } + + public EdgeInfoBuilder addAdjacentList(AdjacentList adjacentList) { + if(adjacentListsAsListTemp == null){ + adjacentListsAsListTemp = new ArrayList<>(); + } + adjacentListsAsListTemp.add(adjacentList); + return this; + } + + public EdgeInfoBuilder adjacentLists(List<AdjacentList> adjacentListsAsList) { + if(adjacentListsAsListTemp == null) { + adjacentListsAsListTemp = new ArrayList<>(); + } + this.adjacentListsAsListTemp.addAll(adjacentListsAsList); + return this; + } + + private EdgeInfoBuilder adjacentLists(Map<AdjListType, AdjacentList> adjacentLists) { Review Comment: Also public ########## maven-projects/info/src/main/java/org/apache/graphar/info/EdgeInfo.java: ########## @@ -51,6 +53,192 @@ public class EdgeInfo { private final PropertyGroups propertyGroups; private final VersionInfo version; + public static EdgeInfoBuilder builder(){ + return new EdgeInfoBuilder(); + } + + public static final class EdgeInfoBuilder { + private EdgeTriplet edgeTriplet; + private long chunkSize; + private long srcChunkSize; + private long dstChunkSize; + private boolean directed; + private String prefix; + private Map<AdjListType, AdjacentList> adjacentLists; + private PropertyGroups propertyGroups; + private VersionInfo version; + + private List<AdjacentList> adjacentListsAsListTemp; + private List<PropertyGroup> propertyGroupsAsListTemp; + + private String srcType; + private String edgeType; + private String dstType; + + + private EdgeInfoBuilder() {} + + + public EdgeInfoBuilder srcType(String srcType) { + this.srcType = srcType; + return this; + } + + public EdgeInfoBuilder edgeType(String edgeType) { + this.edgeType = edgeType; + return this; + } + public EdgeInfoBuilder dstType(String dstType) { + this.dstType = dstType; + return this; + } + + public EdgeInfoBuilder edgeTriplet(String srcType, String edgeType, String dstType) { + this.edgeTriplet = new EdgeTriplet(srcType, edgeType, dstType); + return this; + } + + + private EdgeInfoBuilder edgeTriplet(EdgeTriplet edgeTriplet) { + this.edgeTriplet = edgeTriplet; + return this; + } + + public EdgeInfoBuilder chunkSize(long chunkSize) { + this.chunkSize = chunkSize; + return this; + } + + public EdgeInfoBuilder srcChunkSize(long srcChunkSize) { + this.srcChunkSize = srcChunkSize; + return this; + } + + public EdgeInfoBuilder dstChunkSize(long dstChunkSize) { + this.dstChunkSize = dstChunkSize; + return this; + } + + public EdgeInfoBuilder directed(boolean directed) { + this.directed = directed; + return this; + } + + public EdgeInfoBuilder prefix(String prefix) { + this.prefix = prefix; + return this; + } + + public EdgeInfoBuilder addAdjacentList(AdjacentList adjacentList) { + if(adjacentListsAsListTemp == null){ + adjacentListsAsListTemp = new ArrayList<>(); + } + adjacentListsAsListTemp.add(adjacentList); + return this; + } + + public EdgeInfoBuilder adjacentLists(List<AdjacentList> adjacentListsAsList) { + if(adjacentListsAsListTemp == null) { + adjacentListsAsListTemp = new ArrayList<>(); + } + this.adjacentListsAsListTemp.addAll(adjacentListsAsList); + return this; + } + + private EdgeInfoBuilder adjacentLists(Map<AdjListType, AdjacentList> adjacentLists) { + this.adjacentLists = adjacentLists; + return this; + } + + public EdgeInfoBuilder addPropertyGroups(PropertyGroup propertyGroup) { + if(propertyGroupsAsListTemp == null) + propertyGroupsAsListTemp = new ArrayList<>(); + propertyGroupsAsListTemp.add(propertyGroup); + return this; + } + + public EdgeInfoBuilder addPropertyGroups(List<PropertyGroup> propertyGroups) { + if(propertyGroupsAsListTemp == null) + propertyGroupsAsListTemp = new ArrayList<>(); + propertyGroupsAsListTemp.addAll(propertyGroups); + return this; + } + + private EdgeInfoBuilder addPropertyGroups(PropertyGroups propertyGroups) { Review Comment: change the access modifiers and name to `public propertyGroups` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@graphar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@graphar.apache.org For additional commands, e-mail: commits-h...@graphar.apache.org