Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ The client can be used with Java 1.8+ and pulled into Maven or Gradle projects.
<dependency>
<groupId>com.vertexvis</groupId>
<artifactId>api-client-java</artifactId>
<version>0.15.0</version>
<version>0.16.0</version>
<scope>compile</scope>
</dependency>
```

### Gradle

```groovy
compile "com.vertexvis:api-client-java:0.15.0"
compile "com.vertexvis:api-client-java:0.16.0"
```

### Sbt

```sbt
libraryDependencies += "com.vertexvis" % "api-client-java" % "0.15.0"
libraryDependencies += "com.vertexvis" % "api-client-java" % "0.16.0"
```

### Others
Expand All @@ -44,7 +44,7 @@ mvn clean package

Then manually install the following JARs.

- `target/api-client-java-0.15.0.jar`
- `target/api-client-java-0.16.0.jar`
- `target/lib/*.jar`

## Usage
Expand Down Expand Up @@ -104,7 +104,7 @@ To consume published snapshot versions in other projects, add the snapshot repos
<dependency>
<groupId>com.vertexvis</groupId>
<artifactId>api-client-java</artifactId>
<version>0.15.0-SNAPSHOT</version>
<version>0.16.0-SNAPSHOT</version>
</dependency>
```

Expand All @@ -119,7 +119,7 @@ repositories {
}

dependencies {
implementation 'com.vertexvis:api-client-java:0.15.0-SNAPSHOT'
implementation 'com.vertexvis:api-client-java:0.16.0-SNAPSHOT'
}
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id "io.github.gradle-nexus.publish-plugin"
}

def projectVersion = '0.15.0'
def projectVersion = '0.16.0'
def isSnapshot = project.hasProperty('isSnapshot') && project.isSnapshot.toBoolean()
version = isSnapshot ? "${projectVersion}-SNAPSHOT" : projectVersion

Expand Down
25 changes: 11 additions & 14 deletions examples/src/main/java/com/vertexvis/example/PartCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ private static CreatePartRequest getCreatePartRequest(UUID fileId, String partNa

private static CreatePartRequest createPartAssemblyRequest(List<UUID> revisionIds, String assemblyName) {

PartAssemblyRelationship partAssemblyRelationship = new PartAssemblyRelationship()
.data(new PartAssemblyRelationshipData()
.metadata(Collections.emptyMap())
.children(createPartRevisionInstances(revisionIds))
CreatePartRequestDataRelationships partAssemblyRelationship = new CreatePartRequestDataRelationships()
.instances(new PartInstancesRelationship()
.data(createPartRevisionInstances(revisionIds))
);

var uuid = UUID.randomUUID();
return new CreatePartRequest()
.data(
Expand All @@ -73,23 +73,20 @@ private static CreatePartRequest createPartAssemblyRequest(List<UUID> revisionId
.suppliedId("my-assembly-" + uuid)
.suppliedRevisionId("my-part-rev-" + uuid)
.name(assemblyName))
.relationships(new CreatePartRequestDataRelationships()
.source(new CreatePartRequestDataRelationshipsSource(partAssemblyRelationship))
));
.relationships(partAssemblyRelationship));
}

private static List<PartRevisionInstance> createPartRevisionInstances(List<UUID> ids) {
int num = ids.size();
return IntStream.range(0, num)
.mapToObj(ordinal -> new PartRevisionInstance().
ordinal(ordinal)
.revisionId(ids.get(ordinal))
.transform(new Matrix4()
private static List<PartInstancesRelationshipData> createPartRevisionInstances(List<UUID> ids) {
return ids.stream().map(id -> new PartInstancesRelationshipData()
.type(PartInstancesRelationshipData.TypeEnum.PART_REVISION_INSTANCE)
.id(id)
.attributes(new PartInstancesRelationshipAttributes().transform(new Matrix4()
.r0(createVector4(BigDecimal.ONE, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ONE))
.r1(createVector4(BigDecimal.ZERO, BigDecimal.ONE, BigDecimal.ZERO, BigDecimal.ONE))
.r2(createVector4(BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ONE, BigDecimal.ONE))
.r3(createVector4(BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ONE))
))
)
.collect(Collectors.toList());
}

Expand Down