public class OMultiValue extends Object
Constructor and Description |
---|
OMultiValue() |
Modifier and Type | Method and Description |
---|---|
static Object |
add(Object iObject,
Object iToAdd)
Utility function that add a value to the main object.
|
static Object[] |
array(Object iValue) |
static <T> T[] |
array(Object iValue,
Class<? extends T> iClass) |
static <T> T[] |
array(Object iValue,
Class<? extends T> iClass,
OCallable<Object,Object> iCallback) |
static boolean |
contains(Object iObject,
Object iItem) |
static Object |
convert(Object iObject,
OCallable<Object,Object> iCallback) |
static boolean |
equals(Collection<Object> col1,
Collection<Object> col2) |
static Object |
getFirstValue(Object iObject)
Returns the first item of the Multi-value object (array, collection or map)
|
static Object |
getLastValue(Object iObject)
Returns the last item of the Multi-value object (array, collection or map)
|
static Iterable<Object> |
getMultiValueIterable(Object iObject)
Returns an
Iterable object to browse the multi-value instance (array,
collection or map). |
static Iterable<Object> |
getMultiValueIterable(Object iObject,
boolean iForceConvertRecord)
Returns an
Iterable object to browse the multi-value instance (array,
collection or map). |
static Iterator<Object> |
getMultiValueIterator(Object iObject)
Returns an
Iterator object to browse the multi-value instance (array,
collection or map) |
static Iterator<Object> |
getMultiValueIterator(Object iObject,
boolean iForceConvertRecord)
Returns an
Iterator object to browse the multi-value instance (array,
collection or map) |
static <T> List<T> |
getSingletonList(T item) |
static int |
getSize(Object iObject)
Returns the size of the multi-value object
|
static Object |
getValue(Object iObject,
int iIndex)
Returns the iIndex item of the Multi-value object (array, collection or map)
|
static int |
indexOf(Object iObject,
Object iItem) |
static boolean |
isIterable(Object iObject) |
static boolean |
isMultiValue(Class<?> iType)
Checks if a class is a multi-value type.
|
static boolean |
isMultiValue(Object iObject)
Checks if the object is a multi-value type.
|
static Object |
remove(Object iObject,
Object iToRemove,
boolean iAllOccurrences)
Utility function that remove a value from the main object.
|
protected static void |
removeFromOCollection(Object iObject,
OCollection<Object> coll,
Object iToRemove,
boolean iAllOccurrences) |
static void |
setValue(Object iObject,
Object iValue,
int iIndex)
Sets the value of the Multi-value object (array or collection) at iIndex
|
static Object |
toSet(Object o) |
static String |
toString(Object iObject)
Returns a stringified version of the multi-value object.
|
public static boolean isMultiValue(Class<?> iType)
iType
- Class to checkpublic static boolean isMultiValue(Object iObject)
iObject
- Object to checkpublic static boolean isIterable(Object iObject)
public static int getSize(Object iObject)
iObject
- Multi-value object (array, collection or map)public static Object getFirstValue(Object iObject)
iObject
- Multi-value object (array, collection or map)public static Object getLastValue(Object iObject)
iObject
- Multi-value object (array, collection or map)public static Object getValue(Object iObject, int iIndex)
iObject
- Multi-value object (array, collection or map)iIndex
- integer as the position requestedpublic static void setValue(Object iObject, Object iValue, int iIndex)
iObject
- Multi-value object (array, collection)iValue
- The value to set at this specified index.iIndex
- integer as the position requestedpublic static Iterable<Object> getMultiValueIterable(Object iObject)
Iterable
object to browse the multi-value instance (array,
collection or map).iObject
- Multi-value object (array, collection or map)public static Iterable<Object> getMultiValueIterable(Object iObject, boolean iForceConvertRecord)
Iterable
object to browse the multi-value instance (array,
collection or map).iObject
- Multi-value object (array, collection or map)iForceConvertRecord
- allow to force settings to convert RIDs to records while browsing.public static Iterator<Object> getMultiValueIterator(Object iObject, boolean iForceConvertRecord)
Iterator
object to browse the multi-value instance (array,
collection or map)iObject
- Multi-value object (array, collection or map)iForceConvertRecord
- allow to force settings to convert RIDs to records while browsing.public static Iterator<Object> getMultiValueIterator(Object iObject)
Iterator
object to browse the multi-value instance (array,
collection or map)iObject
- Multi-value object (array, collection or map)public static String toString(Object iObject)
iObject
- Multi-value object (array, collection or map)public static Object add(Object iObject, Object iToAdd)
iObject
- MultiValue where to add value(s)iToAdd
- Single value, array of values or collections of values. Map are not supported.public static Object remove(Object iObject, Object iToRemove, boolean iAllOccurrences)
iObject
- MultiValue where to add value(s)iToRemove
- Single value, array of values or collections of values. Map are not supported.iAllOccurrences
- True if the all occurrences must be removed or false of only the first
one (Like java.util.Collection.remove())protected static void removeFromOCollection(Object iObject, OCollection<Object> coll, Object iToRemove, boolean iAllOccurrences)
public static <T> T[] array(Object iValue, Class<? extends T> iClass, OCallable<Object,Object> iCallback)
public static boolean equals(Collection<Object> col1, Collection<Object> col2)
public static <T> List<T> getSingletonList(T item)
Copyright © 2009–2020 OrientDB. All rights reserved.