Package step.core.accessors
Interface Accessor<T extends step.core.accessors.AbstractIdentifiableObject>
-
- All Known Subinterfaces:
CRUDAccessor<T>,ParameterAccessor,ResourceAccessor,ResourceRevisionAccessor
- All Known Implementing Classes:
InMemoryCRUDAccessor,InMemoryResourceAccessor,InMemoryResourceRevisionAccessor,LayeredCRUDAccessor
public interface Accessor<T extends step.core.accessors.AbstractIdentifiableObject>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TfindByAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)Find an object by default attributes.TfindByAttributes(java.util.Map<java.lang.String,java.lang.String> attributes, java.lang.String attributesMapKey)Find an object by attributes.java.util.Spliterator<T>findManyByAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)Find objects by attributes.java.util.Spliterator<T>findManyByAttributes(java.util.Map<java.lang.String,java.lang.String> attributes, java.lang.String attributesMapKey)Find objects by attributes.Tget(java.lang.String id)Get an object by idTget(org.bson.types.ObjectId id)Get an object by idjava.util.Iterator<T>getAll()java.util.List<T>getRange(int skip, int limit)Get the range of objects specified by the skip/limit parameters browsing the collection sorted by ID in the descending order
-
-
-
Method Detail
-
get
T get(org.bson.types.ObjectId id)
Get an object by id- Parameters:
id- the UID of the object- Returns:
- the object
-
get
T get(java.lang.String id)
Get an object by id- Parameters:
id- the UID of the object- Returns:
- the object
-
findByAttributes
T findByAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Find an object by default attributes. If multiple objects match these attributes, the first one will be returned- Parameters:
attributes- the map of mandatory attributes of the object to be found- Returns:
- the object
-
findManyByAttributes
java.util.Spliterator<T> findManyByAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Find objects by attributes.- Parameters:
attributes- the map of mandatory attributes of the object to be found- Returns:
- an
Iteratorfor the objects found
-
getAll
java.util.Iterator<T> getAll()
-
findByAttributes
T findByAttributes(java.util.Map<java.lang.String,java.lang.String> attributes, java.lang.String attributesMapKey)
Find an object by attributes. If multiple objects match these attributes, the first one will be returned- Parameters:
attributes- the map of mandatory attributes of the object to be foundattributesMapKey- the string representing the name (or "key") of the attribute map- Returns:
- the object
-
findManyByAttributes
java.util.Spliterator<T> findManyByAttributes(java.util.Map<java.lang.String,java.lang.String> attributes, java.lang.String attributesMapKey)
Find objects by attributes.- Parameters:
attributes- the map of mandatory attributes of the object to be foundattributesMapKey- the string representing the name (or "key") of the attribute map- Returns:
- an
Iteratorfor the objects found
-
getRange
java.util.List<T> getRange(int skip, int limit)
Get the range of objects specified by the skip/limit parameters browsing the collection sorted by ID in the descending order- Parameters:
skip- the start index (inclusive) of the rangelimit- the size of the range- Returns:
- a
Listcontaining the objects of the specified range
-
-