KEY
- primary key or handleUnexpectedException of object.ITEM
- item that this repo holds.public class RepoDefault<KEY,ITEM> extends Object implements Repo<KEY,ITEM>, RepoComposer<KEY,ITEM>
Constructor and Description |
---|
RepoDefault() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(ITEM item) |
boolean |
addAll(Collection<? extends ITEM> c) |
void |
addAll(ITEM... items) |
void |
addAll(List<ITEM> items) |
void |
addAllAsync(Collection<ITEM> items) |
void |
addLookupIndex(String name,
LookupIndex<?,?> si) |
void |
addSearchIndex(String name,
SearchIndex<?,?> si) |
List<ITEM> |
all() |
void |
clear() |
boolean |
compareAndIncrement(KEY key,
String property,
byte compare) |
boolean |
compareAndIncrement(KEY key,
String property,
int compare) |
boolean |
compareAndIncrement(KEY key,
String property,
long compare) |
boolean |
compareAndIncrement(KEY key,
String property,
short compare) |
boolean |
compareAndUpdate(KEY key,
String property,
byte compare,
byte value) |
boolean |
compareAndUpdate(KEY key,
String property,
char compare,
char value) |
boolean |
compareAndUpdate(KEY key,
String property,
double compare,
double value) |
boolean |
compareAndUpdate(KEY key,
String property,
float compare,
float value) |
boolean |
compareAndUpdate(KEY key,
String property,
int compare,
int value) |
boolean |
compareAndUpdate(KEY key,
String property,
long compare,
long value) |
boolean |
compareAndUpdate(KEY key,
String property,
Object compare,
Object value) |
boolean |
compareAndUpdate(KEY key,
String property,
short compare,
short value) |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
int |
count(KEY key,
String property,
byte value) |
int |
count(KEY key,
String property,
char value) |
int |
count(KEY key,
String property,
double value) |
int |
count(KEY key,
String property,
float value) |
int |
count(KEY key,
String property,
int value) |
int |
count(KEY key,
String property,
long value) |
int |
count(KEY key,
String property,
Object value) |
int |
count(KEY key,
String property,
short value) |
boolean |
delete(ITEM item) |
ITEM |
get(KEY key) |
byte |
getByte(ITEM item,
String property) |
char |
getChar(ITEM item,
String property) |
double |
getDouble(ITEM item,
String property) |
float |
getFloat(ITEM item,
String property) |
int |
getInt(ITEM item,
String property) |
KEY |
getKey(ITEM item) |
long |
getLong(ITEM item,
String property) |
Object |
getObject(ITEM item,
String property) |
short |
getShort(ITEM item,
String property) |
<T> T |
getValue(ITEM item,
String property,
Class<T> type) |
void |
init() |
Repo |
init(List<ITEM> items) |
void |
invalidateIndex(String property,
ITEM item) |
boolean |
isEmpty() |
Iterator<ITEM> |
iterator() |
<T> T |
max(KEY key,
String property,
Class<T> type) |
double |
maxDouble(KEY key,
String property) |
int |
maxInt(KEY key,
String property) |
long |
maxLong(KEY key,
String property) |
Number |
maxNumber(KEY key,
String property) |
String |
maxString(KEY key,
String property) |
<T> T |
min(KEY key,
String property,
Class<T> type) |
double |
minDouble(KEY key,
String property) |
int |
minInt(KEY key,
String property) |
long |
minLong(KEY key,
String property) |
Number |
minNumber(KEY key,
String property) |
String |
minString(KEY key,
String property) |
void |
modify(ITEM item) |
void |
modify(ITEM item,
String property,
byte value) |
void |
modify(ITEM item,
String property,
char value) |
void |
modify(ITEM item,
String property,
double value) |
void |
modify(ITEM item,
String property,
float value) |
void |
modify(ITEM item,
String property,
int value) |
void |
modify(ITEM item,
String property,
long value) |
void |
modify(ITEM item,
String property,
Object value) |
void |
modify(ITEM item,
String property,
short value) |
void |
modify(ITEM item,
Update... values) |
void |
modifyAll(Collection<ITEM> items) |
void |
modifyAll(ITEM... items) |
void |
modifyByValue(ITEM item,
String property,
String value) |
void |
put(ITEM item) |
List<ITEM> |
query(Criteria... expressions) |
List<ITEM> |
query(List<Criteria> expressions) |
List<Map<String,Object>> |
query(List<Selector> selectors,
Criteria... expressions) |
void |
query(Visitor<KEY,ITEM> visitor,
Criteria... expressions) |
List<Map<String,Object>> |
queryAsMaps(Criteria... expressions) |
byte |
readByte(KEY key,
String property) |
char |
readChar(KEY key,
String property) |
double |
readDouble(KEY key,
String property) |
float |
readFloat(KEY key,
String property) |
int |
readInt(KEY key,
String property) |
long |
readLong(KEY key,
String property) |
byte |
readNestedByte(KEY key,
String... properties) |
char |
readNestedChar(KEY key,
String... properties) |
double |
readNestedDouble(KEY key,
String... properties) |
float |
readNestedFloat(KEY key,
String... properties) |
int |
readNestedInt(KEY key,
String... properties) |
long |
readNestedLong(KEY key,
String... properties) |
short |
readNestedShort(KEY key,
String... properties) |
Object |
readNestedValue(KEY key,
String... properties) |
Object |
readObject(KEY key,
String property) |
short |
readShort(KEY key,
String property) |
<T> T |
readValue(KEY key,
String property,
Class<T> type) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
void |
removeAll(ITEM... items) |
void |
removeAllAsync(Collection<ITEM> items) |
void |
removeByKey(KEY key) |
ResultSet<ITEM> |
results(Criteria... expressions) |
boolean |
retainAll(Collection<?> c) |
void |
setObjectEditor(ObjectEditor editor) |
void |
setSearchableCollection(SearchableCollection<KEY,ITEM> searchableCollection) |
int |
size() |
List<ITEM> |
sortedQuery(Sort sortBy,
Criteria... expressions) |
List<Map<String,Object>> |
sortedQuery(Sort sortBy,
List<Selector> selectors,
Criteria... expressions) |
List<ITEM> |
sortedQuery(String sortBy,
Criteria... expressions) |
List<Map<String,Object>> |
sortedQuery(String sortBy,
List<Selector> selectors,
Criteria... expressions) |
void |
sortedQuery(Visitor<KEY,ITEM> visitor,
Sort sortBy,
Criteria... expressions) |
void |
sortedQuery(Visitor<KEY,ITEM> visitor,
String sortBy,
Criteria... expressions) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
Collection<ITEM> |
toCollection() |
void |
update(ITEM item) |
void |
update(KEY key,
String property,
byte value) |
void |
update(KEY key,
String property,
char value) |
void |
update(KEY key,
String property,
double value) |
void |
update(KEY key,
String property,
float value) |
void |
update(KEY key,
String property,
int value) |
void |
update(KEY key,
String property,
long value) |
void |
update(KEY key,
String property,
Object value) |
void |
update(KEY key,
String property,
short value) |
void |
update(KEY key,
Update... values) |
void |
updateByFilter(List<Update> values,
Criteria... expressions) |
void |
updateByFilter(String property,
byte value,
Criteria... expressions) |
void |
updateByFilter(String property,
char value,
Criteria... expressions) |
void |
updateByFilter(String property,
double value,
Criteria... expressions) |
void |
updateByFilter(String property,
float value,
Criteria... expressions) |
void |
updateByFilter(String property,
int value,
Criteria... expressions) |
void |
updateByFilter(String property,
long value,
Criteria... expressions) |
void |
updateByFilter(String property,
Object value,
Criteria... expressions) |
void |
updateByFilter(String property,
short value,
Criteria... expressions) |
void |
updateByFilterUsingValue(String property,
String value,
Criteria... expressions) |
void |
updateByValue(KEY key,
String property,
String value) |
void |
validateIndex(String property,
ITEM item) |
void |
validateIndexes(ITEM item) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode
public void updateByFilter(String property, Object value, Criteria... expressions)
updateByFilter
in interface Repo<KEY,ITEM>
public void updateByFilterUsingValue(String property, String value, Criteria... expressions)
updateByFilterUsingValue
in interface Repo<KEY,ITEM>
public void updateByFilter(String property, int value, Criteria... expressions)
updateByFilter
in interface Repo<KEY,ITEM>
public void updateByFilter(String property, long value, Criteria... expressions)
updateByFilter
in interface Repo<KEY,ITEM>
public void updateByFilter(String property, char value, Criteria... expressions)
updateByFilter
in interface Repo<KEY,ITEM>
public void updateByFilter(String property, short value, Criteria... expressions)
updateByFilter
in interface Repo<KEY,ITEM>
public void updateByFilter(String property, byte value, Criteria... expressions)
updateByFilter
in interface Repo<KEY,ITEM>
public void updateByFilter(String property, float value, Criteria... expressions)
updateByFilter
in interface Repo<KEY,ITEM>
public void updateByFilter(String property, double value, Criteria... expressions)
updateByFilter
in interface Repo<KEY,ITEM>
public void updateByFilter(List<Update> values, Criteria... expressions)
updateByFilter
in interface Repo<KEY,ITEM>
public ITEM get(KEY key)
get
in interface ObjectEditor<KEY,ITEM>
get
in interface SearchableCollection<KEY,ITEM>
public KEY getKey(ITEM item)
getKey
in interface ObjectEditor<KEY,ITEM>
getKey
in interface SearchableCollection<KEY,ITEM>
public void invalidateIndex(String property, ITEM item)
invalidateIndex
in interface SearchableCollection<KEY,ITEM>
public void validateIndex(String property, ITEM item)
validateIndex
in interface SearchableCollection<KEY,ITEM>
public void validateIndexes(ITEM item)
validateIndexes
in interface SearchableCollection<KEY,ITEM>
public Object readObject(KEY key, String property)
readObject
in interface ObjectEditor<KEY,ITEM>
public <T> T readValue(KEY key, String property, Class<T> type)
readValue
in interface ObjectEditor<KEY,ITEM>
public int readInt(KEY key, String property)
readInt
in interface ObjectEditor<KEY,ITEM>
public long readLong(KEY key, String property)
readLong
in interface ObjectEditor<KEY,ITEM>
public char readChar(KEY key, String property)
readChar
in interface ObjectEditor<KEY,ITEM>
public short readShort(KEY key, String property)
readShort
in interface ObjectEditor<KEY,ITEM>
public byte readByte(KEY key, String property)
readByte
in interface ObjectEditor<KEY,ITEM>
public float readFloat(KEY key, String property)
readFloat
in interface ObjectEditor<KEY,ITEM>
public double readDouble(KEY key, String property)
readDouble
in interface ObjectEditor<KEY,ITEM>
public Object getObject(ITEM item, String property)
getObject
in interface ObjectEditor<KEY,ITEM>
public <T> T getValue(ITEM item, String property, Class<T> type)
getValue
in interface ObjectEditor<KEY,ITEM>
public int getInt(ITEM item, String property)
getInt
in interface ObjectEditor<KEY,ITEM>
public long getLong(ITEM item, String property)
getLong
in interface ObjectEditor<KEY,ITEM>
public char getChar(ITEM item, String property)
getChar
in interface ObjectEditor<KEY,ITEM>
public short getShort(ITEM item, String property)
getShort
in interface ObjectEditor<KEY,ITEM>
public byte getByte(ITEM item, String property)
getByte
in interface ObjectEditor<KEY,ITEM>
public float getFloat(ITEM item, String property)
getFloat
in interface ObjectEditor<KEY,ITEM>
public double getDouble(ITEM item, String property)
getDouble
in interface ObjectEditor<KEY,ITEM>
public int count(KEY key, String property, int value)
count
in interface SearchableCollection<KEY,ITEM>
public int count(KEY key, String property, short value)
count
in interface SearchableCollection<KEY,ITEM>
public int count(KEY key, String property, byte value)
count
in interface SearchableCollection<KEY,ITEM>
public int count(KEY key, String property, long value)
count
in interface SearchableCollection<KEY,ITEM>
public int count(KEY key, String property, char value)
count
in interface SearchableCollection<KEY,ITEM>
public int count(KEY key, String property, float value)
count
in interface SearchableCollection<KEY,ITEM>
public int count(KEY key, String property, double value)
count
in interface SearchableCollection<KEY,ITEM>
public int count(KEY key, String property, Object value)
count
in interface SearchableCollection<KEY,ITEM>
public <T> T max(KEY key, String property, Class<T> type)
max
in interface SearchableCollection<KEY,ITEM>
public String maxString(KEY key, String property)
maxString
in interface SearchableCollection<KEY,ITEM>
public Number maxNumber(KEY key, String property)
maxNumber
in interface SearchableCollection<KEY,ITEM>
public int maxInt(KEY key, String property)
maxInt
in interface SearchableCollection<KEY,ITEM>
public long maxLong(KEY key, String property)
maxLong
in interface SearchableCollection<KEY,ITEM>
public double maxDouble(KEY key, String property)
maxDouble
in interface SearchableCollection<KEY,ITEM>
public <T> T min(KEY key, String property, Class<T> type)
min
in interface SearchableCollection<KEY,ITEM>
public String minString(KEY key, String property)
minString
in interface SearchableCollection<KEY,ITEM>
public Number minNumber(KEY key, String property)
minNumber
in interface SearchableCollection<KEY,ITEM>
public int minInt(KEY key, String property)
minInt
in interface SearchableCollection<KEY,ITEM>
public long minLong(KEY key, String property)
minLong
in interface SearchableCollection<KEY,ITEM>
public double minDouble(KEY key, String property)
minDouble
in interface SearchableCollection<KEY,ITEM>
public ResultSet<ITEM> results(Criteria... expressions)
results
in interface SearchableCollection<KEY,ITEM>
public List<ITEM> query(Criteria... expressions)
query
in interface SearchableCollection<KEY,ITEM>
public List<ITEM> query(List<Criteria> expressions)
query
in interface SearchableCollection<KEY,ITEM>
public List<ITEM> sortedQuery(String sortBy, Criteria... expressions)
sortedQuery
in interface SearchableCollection<KEY,ITEM>
public List<ITEM> sortedQuery(Sort sortBy, Criteria... expressions)
sortedQuery
in interface SearchableCollection<KEY,ITEM>
public List<Map<String,Object>> queryAsMaps(Criteria... expressions)
queryAsMaps
in interface SearchableCollection<KEY,ITEM>
public List<Map<String,Object>> query(List<Selector> selectors, Criteria... expressions)
query
in interface SearchableCollection<KEY,ITEM>
public List<Map<String,Object>> sortedQuery(String sortBy, List<Selector> selectors, Criteria... expressions)
sortedQuery
in interface SearchableCollection<KEY,ITEM>
public List<Map<String,Object>> sortedQuery(Sort sortBy, List<Selector> selectors, Criteria... expressions)
sortedQuery
in interface SearchableCollection<KEY,ITEM>
public void query(Visitor<KEY,ITEM> visitor, Criteria... expressions)
query
in interface SearchableCollection<KEY,ITEM>
public void sortedQuery(Visitor<KEY,ITEM> visitor, String sortBy, Criteria... expressions)
sortedQuery
in interface SearchableCollection<KEY,ITEM>
public void sortedQuery(Visitor<KEY,ITEM> visitor, Sort sortBy, Criteria... expressions)
sortedQuery
in interface SearchableCollection<KEY,ITEM>
public void put(ITEM item)
put
in interface ObjectEditor<KEY,ITEM>
public void removeByKey(KEY key)
removeByKey
in interface ObjectEditor<KEY,ITEM>
removeByKey
in interface SearchableCollection<KEY,ITEM>
public void removeAll(ITEM... items)
removeAll
in interface ObjectEditor<KEY,ITEM>
public void removeAllAsync(Collection<ITEM> items)
removeAllAsync
in interface ObjectEditor<KEY,ITEM>
public void addAll(ITEM... items)
addAll
in interface ObjectEditor<KEY,ITEM>
public void addAllAsync(Collection<ITEM> items)
addAllAsync
in interface ObjectEditor<KEY,ITEM>
public void modifyAll(ITEM... items)
modifyAll
in interface ObjectEditor<KEY,ITEM>
public void modifyAll(Collection<ITEM> items)
modifyAll
in interface ObjectEditor<KEY,ITEM>
public void modify(ITEM item)
modify
in interface ObjectEditor<KEY,ITEM>
public void update(ITEM item)
update
in interface ObjectEditor<KEY,ITEM>
public void modifyByValue(ITEM item, String property, String value)
modifyByValue
in interface ObjectEditor<KEY,ITEM>
public void modify(ITEM item, String property, Object value)
modify
in interface ObjectEditor<KEY,ITEM>
public void modify(ITEM item, String property, int value)
modify
in interface ObjectEditor<KEY,ITEM>
public void modify(ITEM item, String property, long value)
modify
in interface ObjectEditor<KEY,ITEM>
public void modify(ITEM item, String property, char value)
modify
in interface ObjectEditor<KEY,ITEM>
public void modify(ITEM item, String property, short value)
modify
in interface ObjectEditor<KEY,ITEM>
public void modify(ITEM item, String property, byte value)
modify
in interface ObjectEditor<KEY,ITEM>
public void modify(ITEM item, String property, float value)
modify
in interface ObjectEditor<KEY,ITEM>
public void modify(ITEM item, String property, double value)
modify
in interface ObjectEditor<KEY,ITEM>
public void modify(ITEM item, Update... values)
modify
in interface ObjectEditor<KEY,ITEM>
public void updateByValue(KEY key, String property, String value)
updateByValue
in interface ObjectEditor<KEY,ITEM>
public void update(KEY key, String property, Object value)
update
in interface ObjectEditor<KEY,ITEM>
public void update(KEY key, String property, int value)
update
in interface ObjectEditor<KEY,ITEM>
public void update(KEY key, String property, long value)
update
in interface ObjectEditor<KEY,ITEM>
public void update(KEY key, String property, char value)
update
in interface ObjectEditor<KEY,ITEM>
public void update(KEY key, String property, short value)
update
in interface ObjectEditor<KEY,ITEM>
public void update(KEY key, String property, byte value)
update
in interface ObjectEditor<KEY,ITEM>
public void update(KEY key, String property, float value)
update
in interface ObjectEditor<KEY,ITEM>
public void update(KEY key, String property, double value)
update
in interface ObjectEditor<KEY,ITEM>
public void update(KEY key, Update... values)
update
in interface ObjectEditor<KEY,ITEM>
public boolean compareAndUpdate(KEY key, String property, Object compare, Object value)
compareAndUpdate
in interface ObjectEditor<KEY,ITEM>
public boolean compareAndUpdate(KEY key, String property, int compare, int value)
compareAndUpdate
in interface ObjectEditor<KEY,ITEM>
public boolean compareAndUpdate(KEY key, String property, long compare, long value)
compareAndUpdate
in interface ObjectEditor<KEY,ITEM>
public boolean compareAndUpdate(KEY key, String property, char compare, char value)
compareAndUpdate
in interface ObjectEditor<KEY,ITEM>
public boolean compareAndUpdate(KEY key, String property, short compare, short value)
compareAndUpdate
in interface ObjectEditor<KEY,ITEM>
public boolean compareAndUpdate(KEY key, String property, byte compare, byte value)
compareAndUpdate
in interface ObjectEditor<KEY,ITEM>
public boolean compareAndUpdate(KEY key, String property, float compare, float value)
compareAndUpdate
in interface ObjectEditor<KEY,ITEM>
public boolean compareAndUpdate(KEY key, String property, double compare, double value)
compareAndUpdate
in interface ObjectEditor<KEY,ITEM>
public boolean compareAndIncrement(KEY key, String property, int compare)
compareAndIncrement
in interface ObjectEditor<KEY,ITEM>
public boolean compareAndIncrement(KEY key, String property, long compare)
compareAndIncrement
in interface ObjectEditor<KEY,ITEM>
public boolean compareAndIncrement(KEY key, String property, short compare)
compareAndIncrement
in interface ObjectEditor<KEY,ITEM>
public boolean compareAndIncrement(KEY key, String property, byte compare)
compareAndIncrement
in interface ObjectEditor<KEY,ITEM>
public void addAll(List<ITEM> items)
addAll
in interface ObjectEditor<KEY,ITEM>
public Object readNestedValue(KEY key, String... properties)
readNestedValue
in interface ObjectEditor<KEY,ITEM>
public int readNestedInt(KEY key, String... properties)
readNestedInt
in interface ObjectEditor<KEY,ITEM>
public short readNestedShort(KEY key, String... properties)
readNestedShort
in interface ObjectEditor<KEY,ITEM>
public char readNestedChar(KEY key, String... properties)
readNestedChar
in interface ObjectEditor<KEY,ITEM>
public byte readNestedByte(KEY key, String... properties)
readNestedByte
in interface ObjectEditor<KEY,ITEM>
public double readNestedDouble(KEY key, String... properties)
readNestedDouble
in interface ObjectEditor<KEY,ITEM>
public float readNestedFloat(KEY key, String... properties)
readNestedFloat
in interface ObjectEditor<KEY,ITEM>
public long readNestedLong(KEY key, String... properties)
readNestedLong
in interface ObjectEditor<KEY,ITEM>
public boolean add(ITEM item)
public boolean remove(Object o)
remove
in interface Collection<ITEM>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<ITEM>
public boolean addAll(Collection<? extends ITEM> c)
addAll
in interface Collection<ITEM>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<ITEM>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<ITEM>
public boolean delete(ITEM item)
public void addSearchIndex(String name, SearchIndex<?,?> si)
addSearchIndex
in interface SearchableCollection<KEY,ITEM>
public void addLookupIndex(String name, LookupIndex<?,?> si)
addLookupIndex
in interface SearchableCollection<KEY,ITEM>
public int size()
public boolean isEmpty()
isEmpty
in interface Collection<ITEM>
public boolean contains(Object o)
contains
in interface Collection<ITEM>
public Object[] toArray()
toArray
in interface Collection<ITEM>
public <T> T[] toArray(T[] a)
toArray
in interface Collection<ITEM>
public Collection<ITEM> toCollection()
toCollection
in interface Bag<ITEM>
public void clear()
public void setSearchableCollection(SearchableCollection<KEY,ITEM> searchableCollection)
setSearchableCollection
in interface RepoComposer<KEY,ITEM>
public void init()
init
in interface RepoComposer<KEY,ITEM>
public void setObjectEditor(ObjectEditor editor)
setObjectEditor
in interface RepoComposer<KEY,ITEM>
Copyright © 2014. All rights reserved.