/** * Creates a path to the root of the JSON object that represents the * SCIM resource. * * @return The path to the root of the JSON object that represents the * SCIM resource. */ public static Path root() { return new Path(null, Collections.<Element>emptyList()); }
/** * Creates a path to the root of the JSON object that represents the * SCIM resource. * * @return The path to the root of the JSON object that represents the * SCIM resource. */ public static Path root() { return new Path(null, Collections.<Element>emptyList()); }
/** * Creates a new path from beginning portion of this path to the specified * index (exclusive). The last element in the newly created path will be * the provided index - 1. * * @param index The exclusive index of the endpoint path element. * @return A new path to a beginning portion of this path. * @throws IndexOutOfBoundsException if the index is out of range * (<tt>index < 0 || index > size()</tt>) */ public Path subPath(final int index) throws IndexOutOfBoundsException { return new Path(schemaUrn, elements.subList(0, index)); }
/** * Creates a new path from beginning portion of this path to the specified * index (exclusive). The last element in the newly created path will be * the provided index - 1. * * @param index The exclusive index of the endpoint path element. * @return A new path to a beginning portion of this path. * @throws IndexOutOfBoundsException if the index is out of range * (<tt>index < 0 || index > size()</tt>) */ public Path subPath(final int index) throws IndexOutOfBoundsException { return new Path(schemaUrn, elements.subList(0, index)); }
/** * Create a new path to a sub-attribute of the attribute referenced by this * path. * * @param attribute The name of the sub-attribute. * * @return A new path to a sub-attribute of the attribute referenced by this * path. */ public Path attribute(final String attribute) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.add(new Element(attribute, null)); return new Path(schemaUrn, newElements); }
/** * Create a new path to a sub-set of values of a sub-attribute of the * attribute referenced by this path. * * @param attribute The name of the sub-attribute. * @param valueFilter The value filter. * * @return A new path to a sub-attribute of the attribute referenced by this * path. */ public Path attribute(final String attribute, final Filter valueFilter) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.add(new Element(attribute, valueFilter)); return new Path(schemaUrn, newElements); }
/** * Create a new path to a sub-attribute of the attribute referenced by this * path. * * @param attribute The name of the sub-attribute. * * @return A new path to a sub-attribute of the attribute referenced by this * path. */ public Path attribute(final String attribute) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.add(new Element(attribute, null)); return new Path(schemaUrn, newElements); }
/** * Create a new path to the sub-attribute path of the attribute referenced by * this path. * * @param path The path of the sub-attribute. * * @return A new path to a sub-attribute of the attribute referenced by this * path. */ public Path attribute(final Path path) { List<Element> newElements = new ArrayList<Element>( this.elements.size() + path.size()); newElements.addAll(this.elements); newElements.addAll(path.elements); return new Path(schemaUrn, newElements); }
/** * Create a new path to a sub-set of values of a sub-attribute of the * attribute referenced by this path. * * @param attribute The name of the sub-attribute. * @param valueFilter The value filter. * * @return A new path to a sub-attribute of the attribute referenced by this * path. */ public Path attribute(final String attribute, final Filter valueFilter) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.add(new Element(attribute, valueFilter)); return new Path(schemaUrn, newElements); }
/** * Create a new path to the sub-attribute path of the attribute referenced by * this path. * * @param path The path of the sub-attribute. * * @return A new path to a sub-attribute of the attribute referenced by this * path. */ public Path attribute(final Path path) { List<Element> newElements = new ArrayList<Element>( this.elements.size() + path.size()); newElements.addAll(this.elements); newElements.addAll(path.elements); return new Path(schemaUrn, newElements); }
/** * Create a new path where the attribute and filter at the specified index * is replaced with those provided. * * @param index The index of the element to replace. * @param attribute The replacement attribute. * @param valueFilter The replacement value filter. * @return The new path. */ public Path replace(final int index, final String attribute, final Filter valueFilter) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.set(index, new Element(attribute, valueFilter)); return new Path(schemaUrn, newElements); }
/** * Creates a path to the root of the JSON object that contains all the * attributes of a schema. * * @param schemaUrn The schema URN or {@code null}. * * @return The path to the root of the JSON object that contains all the * attributes of an extension URN. */ public static Path root(final String schemaUrn) { if(schemaUrn != null && !SchemaUtils.isUrn(schemaUrn)) { throw new IllegalArgumentException( String.format("Invalid extension schema URN: %s", schemaUrn)); } return new Path(schemaUrn, Collections.<Element>emptyList()); }
/** * Creates a path to the root of the JSON object that contains all the * attributes of a schema. * * @param schemaUrn The schema URN or {@code null}. * * @return The path to the root of the JSON object that contains all the * attributes of an extension URN. */ public static Path root(final String schemaUrn) { if(schemaUrn != null && !SchemaUtils.isUrn(schemaUrn)) { throw new IllegalArgumentException( String.format("Invalid extension schema URN: %s", schemaUrn)); } return new Path(schemaUrn, Collections.<Element>emptyList()); }
/** * Create a new path where the attribute and filter at the specified index * is replaced with those provided. * * @param index The index of the element to replace. * @param attribute The replacement attribute. * @param valueFilter The replacement value filter. * @return The new path. */ public Path replace(final int index, final String attribute, final Filter valueFilter) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.set(index, new Element(attribute, valueFilter)); return new Path(schemaUrn, newElements); }
/** * Create a new path from this path with any value filters removed. * * @return A new path from this path with any value filters removed. */ public Path withoutFilters() { ArrayList<Element> newElements = new ArrayList<Element>(elements.size()); for(Element element : elements) { newElements.add(new Element(element.getAttribute(), null)); } return new Path(schemaUrn, newElements); }
/** * Create a new path from this path with any value filters removed. * * @return A new path from this path with any value filters removed. */ public Path withoutFilters() { ArrayList<Element> newElements = new ArrayList<Element>(elements.size()); for(Element element : elements) { newElements.add(new Element(element.getAttribute(), null)); } return new Path(schemaUrn, newElements); }
/** * Create a new path where the filter at the specified index is replaced with * the one provided. * * @param index The index of the element to replace. * @param valueFilter The replacement value filter. * @return The new path. */ public Path replace(final int index, final Filter valueFilter) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.set(index, new Element(this.elements.get(index).getAttribute(), valueFilter)); return new Path(schemaUrn, newElements); }
/** * Create a new path where the attribute at the specified index is replaced * with the one provided. * * @param index The index of the element to replace. * @param attribute The replacement attribute. * @return The new path. */ public Path replace(final int index, final String attribute) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.set(index, new Element(attribute, this.elements.get(index).getValueFilter())); return new Path(schemaUrn, newElements); }
/** * Create a new path where the attribute at the specified index is replaced * with the one provided. * * @param index The index of the element to replace. * @param attribute The replacement attribute. * @return The new path. */ public Path replace(final int index, final String attribute) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.set(index, new Element(attribute, this.elements.get(index).getValueFilter())); return new Path(schemaUrn, newElements); }
/** * Create a new path where the filter at the specified index is replaced with * the one provided. * * @param index The index of the element to replace. * @param valueFilter The replacement value filter. * @return The new path. */ public Path replace(final int index, final Filter valueFilter) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.set(index, new Element(this.elements.get(index).getAttribute(), valueFilter)); return new Path(schemaUrn, newElements); }