/** * User email * */ public PathSpec email() { return new PathSpec(getPathComponents(), "email"); }
/** * operations where compression should be used * */ public PathSpec responseCompressionOperations(Integer start, Integer count) { PathSpec arrayPathSpec = new PathSpec(getPathComponents(), "responseCompressionOperations"); if (start!= null) { arrayPathSpec.setAttribute("start", start); } if (count!= null) { arrayPathSpec.setAttribute("count", count); } return arrayPathSpec; }
PathSpec subpath = new PathSpec(path.getPathComponents(), segment); Object value = entry.getValue(); if (value instanceof Integer)
private static Object[] pathSpecToPathMatchPattern(PathSpec pathSpec) { List<String> pathComponents = pathSpec.getPathComponents(); Object[] results = new Object[pathComponents.size()]; int i = 0; for (String pathComponent : pathComponents) { if (pathComponent == PathSpec.WILDCARD) { results[i++] = Wildcard.ANY_ONE; } else { results[i++] = pathComponent; } } return results; }
List<String> segments = path.getPathComponents(); Map<String, Object> attributes = path.getPathAttributes();
/** * If the specified mask contains array range attributes, add them to the pathSpec parameter and return the updated * pathSpec. If the mask doesn't have any array range attributes return an empty Optional. */ private Optional<PathSpec> addArrayRangeAttributes(DataMap mask, PathSpec pathSpec) { Object start = mask.get(FilterConstants.START); if (start != null) { pathSpec.setAttribute(PathSpec.ATTR_ARRAY_START, start); } Object count = mask.get(FilterConstants.COUNT); if (count != null) { pathSpec.setAttribute(PathSpec.ATTR_ARRAY_COUNT, count); } return (start != null || count != null) ? Optional.of(pathSpec) : Optional.empty(); }
/** * Obtain a flattened represented of this {@link MaskTree}, represented as a Map from field path to * {@link MaskOperation}. * @return Map representing flattened MaskTree. */ public Map<PathSpec, MaskOperation> getOperations() { Map<PathSpec, MaskOperation> result = new HashMap<PathSpec, MaskOperation>(); getOperationsImpl(_representation, PathSpec.emptyPath(), result); return result; }
/** * supported content encodings for requests * */ public PathSpec requestContentEncodings(Integer start, Integer count) { PathSpec arrayPathSpec = new PathSpec(getPathComponents(), "requestContentEncodings"); if (start!= null) { arrayPathSpec.setAttribute("start", start); } if (count!= null) { arrayPathSpec.setAttribute("count", count); } return arrayPathSpec; }
@Override public String toString() { StringBuilder rep = new StringBuilder(); for (String s: getPathComponents()) { rep.append(SEPARATOR); rep.append(s); } boolean beforeAttributes = true; if (!_attributes.isEmpty()) { for (Map.Entry<String, Object> attribute: _attributes.entrySet()) { rep.append(beforeAttributes ? PATH_ATTR_SEPARATOR : ATTR_SEPARATOR); rep.append(attribute.getKey()); rep.append(ATTR_KEY_VALUE_SEPARATOR); rep.append(attribute.getValue()); beforeAttributes = false; } } return rep.toString(); }
/** * The username this session * */ public PathSpec userId() { return new PathSpec(getPathComponents(), "userId"); }
/** * Prioritized order of strategy that this service should use. * */ public PathSpec loadBalancerStrategyList(Integer start, Integer count) { PathSpec arrayPathSpec = new PathSpec(getPathComponents(), "loadBalancerStrategyList"); if (start!= null) { arrayPathSpec.setAttribute("start", start); } if (count!= null) { arrayPathSpec.setAttribute("count", count); } return arrayPathSpec; }
final List<String> components = p.getPathComponents(); DataMap currentMap = filteredPathSpecs; boolean isPresent = true;
/** * Low watermark * */ public PathSpec lowWatermark() { return new PathSpec(getPathComponents(), "lowWatermark"); }
/** * banned Uris for this cluster * */ public PathSpec bannedUris(Integer start, Integer count) { PathSpec arrayPathSpec = new PathSpec(getPathComponents(), "bannedUris"); if (start!= null) { arrayPathSpec.setAttribute("start", start); } if (count!= null) { arrayPathSpec.setAttribute("count", count); } return arrayPathSpec; }
/** * Adds the operation op to the key path. * * @param path the path to a field in the object * @param op the operation to apply to the path */ public void addOperation(PathSpec path, PatchOperation op) { List<String> segments = path.getPathComponents(); DataMap map = _representation; for (int ii = 0; ii<segments.size() - 1; ++ii) { String segment = Escaper.escapePathSegment(segments.get(ii)); Object o = map.get(segment); if (o == null) { DataMap childMap = new DataMap(); map.put(segment, childMap); map = childMap; } else { map = (DataMap)o; } } String lastSegment = Escaper.escapePathSegment(segments.get(segments.size()-1)); op.store(map, lastSegment); }
/** * Metric value * */ public PathSpec value() { return new PathSpec(getPathComponents(), "value"); }
/** * Class names for the implemented BasePartitionAccessor * */ public PathSpec classNames(Integer start, Integer count) { PathSpec arrayPathSpec = new PathSpec(getPathComponents(), "classNames"); if (start!= null) { arrayPathSpec.setAttribute("start", start); } if (count!= null) { arrayPathSpec.setAttribute("count", count); } return arrayPathSpec; }
final List<String> components = p.getPathComponents(); DataMap currentMap = pathSpecMap;
/** * true/false if the response should include task metrics (default: true) * */ public PathSpec includeTaskMetrics() { return new PathSpec(getPathComponents(), "includeTaskMetrics"); }
/** * The URIs of machines that belong to this cluster * */ public PathSpec uris(Integer start, Integer count) { PathSpec arrayPathSpec = new PathSpec(getPathComponents(), "uris"); if (start!= null) { arrayPathSpec.setAttribute("start", start); } if (count!= null) { arrayPathSpec.setAttribute("count", count); } return arrayPathSpec; }