@Test public void testCompareTo() { final ForcedRoot left = new ForcedRoot().withPath("/a"); final ForcedRoot right = new ForcedRoot().withPath("/b"); assertEquals("compare based on paths", "/a".compareTo("/b"), left.compareTo(right)); }
@Override public int compareTo(final @NotNull ForcedRoot o) { return (Optional.ofNullable(this.getPath()).orElse("") + "/") .compareTo(Optional.ofNullable(o.getPath()).orElse("") + "/"); }
ForcedRoot implements JsonObjectConvertible, Comparable<ForcedRoot> { @Override public int compareTo(final @NotNull ForcedRoot o) { return (Optional.ofNullable(this.getPath()).orElse("") + "/") .compareTo(Optional.ofNullable(o.getPath()).orElse("") + "/"); } }
ForcedRoot implements JsonObjectConvertible, Comparable<ForcedRoot> { @Override public int compareTo(final @NotNull ForcedRoot o) { return (Optional.ofNullable(this.getPath()).orElse("") + "/") .compareTo(Optional.ofNullable(o.getPath()).orElse("") + "/"); }  }
ForcedRoot implements JsonObjectConvertible, Comparable<ForcedRoot> { @Override public int compareTo(final @NotNull ForcedRoot o) { return (Optional.ofNullable(this.getPath()).orElse("") + "/") .compareTo(Optional.ofNullable(o.getPath()).orElse("") + "/"); }  @NotNull static ForcedRoot.JsonKeys keys(); @Nullable String getPath(); void setPath(final @Nullable String path); @Nullable String getPrimaryType(); void setPrimaryType(final @Nullable String primaryType); @NotNull List<String> getMixinTypes(); void setMixinTypes(final @Nullable List<String> mixinTypes); @SuppressWarnings("WeakerAccess") ForcedRoot withPath(final @Nullable String path); @SuppressWarnings("WeakerAccess") ForcedRoot withPrimaryType(final @Nullable String primaryType); @SuppressWarnings("WeakerAccess") ForcedRoot withMixinTypes(final @NotNull String... mixinTypes); final boolean hasPath(); static @NotNull ForcedRoot fromJson(final @NotNull JsonObject json); @NotNull String[] getNamespacePrefixes(); @Override JsonObject toJson(); @Override int compareTo(final @NotNull ForcedRoot o); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
ForcedRoot implements JsonObjectConvertible, Comparable<ForcedRoot> { @Override public int compareTo(final @NotNull ForcedRoot o) { return (Optional.ofNullable(this.getPath()).orElse("") + "/") .compareTo(Optional.ofNullable(o.getPath()).orElse("") + "/"); }  @NotNull static ForcedRoot.JsonKeys keys(); @Nullable String getPath(); void setPath(final @Nullable String path); @Nullable String getPrimaryType(); void setPrimaryType(final @Nullable String primaryType); @NotNull List<String> getMixinTypes(); void setMixinTypes(final @Nullable List<String> mixinTypes); @SuppressWarnings("WeakerAccess") ForcedRoot withPath(final @Nullable String path); @SuppressWarnings("WeakerAccess") ForcedRoot withPrimaryType(final @Nullable String primaryType); @SuppressWarnings("WeakerAccess") ForcedRoot withMixinTypes(final @NotNull String... mixinTypes); final boolean hasPath(); static @NotNull ForcedRoot fromJson(final @NotNull JsonObject json); @NotNull String[] getNamespacePrefixes(); @Override JsonObject toJson(); @Override int compareTo(final @NotNull ForcedRoot o); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }