@Test public void testReplace_01() { Path path0 = new Path("identifications.defaultClassification.kingdom"); Path path1 = new Path("identifications.defaultClassification.phylum"); assertEquals("01", path1, path0.replace(2, "phylum")); Path path2 = new Path("test.defaultClassification.phylum"); assertEquals("02", path2, path1.replace(0, "test")); }
public Path replace(int element, String newValue) { String[] copy = Arrays.copyOf(elems, elems.length); copy[element] = newValue; return new Path(copy); }
Path implements Comparable<Path> { public Path replace(int element, String newValue) { String[] copy = Arrays.copyOf(elems, elems.length); copy[element] = newValue; return new Path(copy); } }
Path implements Comparable<Path> { public Path replace(int element, String newValue) { String[] copy = Arrays.copyOf(elems, elems.length); copy[element] = newValue; return new Path(copy); } Path(); @JsonCreator  Path(String path);  Path(String[] elements);  Path(Path other); }
Path implements Comparable<Path> { public Path replace(int element, String newValue) { String[] copy = Arrays.copyOf(elems, elems.length); copy[element] = newValue; return new Path(copy); } Path(); @JsonCreator  Path(String path);  Path(String[] elements);  Path(Path other); Path element(int index); String getElement(int index); int countElements(); Path getPurePath(); Path append(String path); Path append(Path other); Path replace(int element, String newValue); Path shift(); @Override boolean equals(Object obj); @Override int hashCode(); @Override @JsonValue String toString(); @Override int compareTo(Path other); }
Path implements Comparable<Path> { public Path replace(int element, String newValue) { String[] copy = Arrays.copyOf(elems, elems.length); copy[element] = newValue; return new Path(copy); } Path(); @JsonCreator  Path(String path);  Path(String[] elements);  Path(Path other); Path element(int index); String getElement(int index); int countElements(); Path getPurePath(); Path append(String path); Path append(Path other); Path replace(int element, String newValue); Path shift(); @Override boolean equals(Object obj); @Override int hashCode(); @Override @JsonValue String toString(); @Override int compareTo(Path other);  }