Package com.github.eikecochu.sqlbuilder
Interface ValueHolder
-
- All Superinterfaces:
java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.Object>>
- All Known Implementing Classes:
Values
public interface ValueHolder extends java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.Object>>The ValueHolder instance allows to declare an arbitrary class as a ValueHolder to be used in various methods of the SQLBuilder, for example Where.where(ValueHolder). Instead of passing all values of an object manually, this interface can be used to extract multiple values at once from any object of classes that implement it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classValueHolder.EntryWrapperThe EntryWrapper is a wrapper around the Map.Entry class to support automatic key prefixing.static classValueHolder.ValueEntryThe ValueEntry class is an implementation of the Map.Entry class
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static java.util.Map.Entry<java.lang.String,java.lang.Object>entry(java.lang.String string, java.lang.Object object)Creates a new Map.Entry instancestatic ValueHolderfrom(java.lang.Iterable<? extends java.util.Map.Entry<java.lang.String,java.lang.Object>> it)Create a ValueHolder from an Iterable instancestatic ValueHolderfrom(java.util.Map<java.lang.String,java.lang.Object> map)Creates a ValueHolder instance from a Map instancedefault java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.Object>>iterator()default java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.Object>>values(java.lang.String columnPrefix)Returns the values stored in this ValueHolder.
-
-
-
Method Detail
-
from
static ValueHolder from(java.lang.Iterable<? extends java.util.Map.Entry<java.lang.String,java.lang.Object>> it)
Create a ValueHolder from an Iterable instance- Parameters:
it- The Iterable- Returns:
- the ValueHolder instance
-
from
static ValueHolder from(java.util.Map<java.lang.String,java.lang.Object> map)
Creates a ValueHolder instance from a Map instance- Parameters:
map- The Map- Returns:
- the ValueHolder instance
-
entry
static java.util.Map.Entry<java.lang.String,java.lang.Object> entry(java.lang.String string, java.lang.Object object)Creates a new Map.Entry instance- Parameters:
string- the keyobject- the value- Returns:
- the new Map.Entry instance
-
iterator
default java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.Object>> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.Object>>
-
values
default java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.Object>> values(java.lang.String columnPrefix)
Returns the values stored in this ValueHolder. Optionally prefixes the keys with a column prefix.- Parameters:
columnPrefix- The optional columnPrefix. Pass null to disable. Pass a value to prefix all keys with this prefix. The prefix and the key are joined with a "."- Returns:
- The value iterator
-
-