Package io.karatelabs.match
Class Value
java.lang.Object
io.karatelabs.match.Value
- All Implemented Interfaces:
io.karatelabs.js.ObjectLike,io.karatelabs.js.SimpleObject
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longMemory threshold in bytes above which collections are stored on disk.Fields inherited from interface io.karatelabs.js.SimpleObject
TO_STRING -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes any resources held by this value (e.g., disk-backed stores).containsAny(Object expected) containsDeep(Object expected) containsOnly(Object expected) containsOnlyDeep(Object expected) eachContains(Object expected) eachContainsAny(Object expected) eachContainsDeep(Object expected) eachContainsOnly(Object expected) eachEquals(Object expected) eachNotContains(Object expected) eachNotEquals(Object expected) Returns the large value store for disk-backed collections, or null.getListElement(int index) Gets an element at the specified index, working for both regular and large collections.intReturns the size of a list, working for both regular and large collections.<T> TgetValue()is(Match.Type matchType, Object expected) booleanbooleanReturns true if this value contains a large collection stored on disk.booleanisList()booleanisMap()booleanisNull()booleanisNumber()booleanisString()booleanisXml()Returns an iterator over list elements, working for both regular and large collections.notContains(Object expected) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.karatelabs.js.ObjectLike
getMember, getPrototype, isExtensible, isFrozen, isOwnProperty, isSealed, putMember, removeMember, setExtensible, setFrozen, setSealedMethods inherited from interface io.karatelabs.js.SimpleObject
getMember, jsKeys, jsToString, putMember, removeMember, toMap
-
Field Details
-
MEMORY_THRESHOLD
public static final long MEMORY_THRESHOLDMemory threshold in bytes above which collections are stored on disk. Default is 10MB.- See Also:
-
-
Method Details
-
isBoolean
public boolean isBoolean() -
isNumber
public boolean isNumber() -
isString
public boolean isString() -
isNull
public boolean isNull() -
isMap
public boolean isMap() -
isList
public boolean isList() -
isXml
public boolean isXml() -
isLargeCollection
public boolean isLargeCollection()Returns true if this value contains a large collection stored on disk. -
getLargeStore
Returns the large value store for disk-backed collections, or null. -
getListSize
public int getListSize()Returns the size of a list, working for both regular and large collections.- Returns:
- the list size, or -1 if not a list
-
listIterator
Returns an iterator over list elements, working for both regular and large collections.- Returns:
- an iterator, or null if not a list
-
getListElement
Gets an element at the specified index, working for both regular and large collections.- Parameters:
index- the index- Returns:
- the element at that index
-
close
public void close()Closes any resources held by this value (e.g., disk-backed stores). -
getValue
public <T> T getValue() -
getAsString
-
toString
-
is
-
_equals
-
contains
-
containsDeep
-
containsOnly
-
containsOnlyDeep
-
containsAny
-
notEquals
-
notContains
-
eachEquals
-
eachNotEquals
-
eachContains
-
eachNotContains
-
eachContainsDeep
-
eachContainsOnly
-
eachContainsAny
-
within
-
notWithin
-
jsGet
- Specified by:
jsGetin interfaceio.karatelabs.js.SimpleObject
-