use of com.google.api.tools.framework.aspects.http.model.HttpAttribute.FieldSegment in project toolkit by googleapis.
the class CollectionPattern method getCollectionPatternsFromMethod.
/**
* Returns a list of CollectionPattern objects.
*/
public static List<CollectionPattern> getCollectionPatternsFromMethod(Method method) {
List<CollectionPattern> collectionPatterns = new LinkedList<CollectionPattern>();
HttpAttribute httpAttr = method.getAttribute(HttpAttribute.KEY);
if (httpAttr != null) {
for (PathSegment pathSegment : httpAttr.getPath()) {
if (CollectionPattern.isValidCollectionPattern(pathSegment)) {
collectionPatterns.add(CollectionPattern.create((FieldSegment) pathSegment));
}
}
}
return collectionPatterns;
}
Aggregations