Package org.graylog2.plugin.lookup
Class LookupResult
java.lang.Object
org.graylog2.plugin.lookup.LookupResult
The result of looking up a key in a lookup table (i. e. lookup data adapter or lookup cache).
For convenience, this class can be serialized and deserialized with Jackson (see
ObjectMapper, but we strongly recommend implementing your own
serialization and deserialization logic if you're implementing a lookup cache.
There are no guarantees about binary compatibility of this class across Graylog releases!
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LookupResult.BuilderaddDefaults(LookupDefaultSingleValue singleValue, LookupDefaultMultiValue multiValue) static LookupResult.Builderbuilder()abstract longcacheTTL()The time to live (in milliseconds) for a LookupResult instance.static LookupResultcreateFromJSON(Object singleValue, Map<Object, Object> multiValue, List<String> stringListValue, boolean hasError, long cacheTTL) static LookupResultempty()abstract booleanhasError()booleanhasTTL()booleanisEmpty()static LookupResultstatic LookupResultmulti(CharSequence singleValue, Map<Object, Object> multiValue) static LookupResultstatic LookupResultstatic LookupResultsingle(CharSequence singleValue) static LookupResultabstract Objectstatic LookupResultwithDefaults(LookupDefaultSingleValue singleValue, LookupDefaultMultiValue multiValue) static LookupResultstatic LookupResultwithError(long errorTTL) static LookupResultstatic LookupResult.Builder
-
Field Details
-
SINGLE_VALUE_KEY
- See Also:
-
-
Constructor Details
-
LookupResult
public LookupResult()
-
-
Method Details
-
singleValue
-
multiValue
-
stringListValue
-
hasError
public abstract boolean hasError() -
cacheTTL
public abstract long cacheTTL()The time to live (in milliseconds) for a LookupResult instance. Prevents repeated lookups for the same key during the time to live period. Depending on the LookupCache implementation this might be ignored. -
isEmpty
public boolean isEmpty() -
hasTTL
public boolean hasTTL() -
empty
-
withError
-
withError
-
withError
-
single
-
single
-
single
-
multi
-
multi
-
multi
-
withDefaults
public static LookupResult withDefaults(LookupDefaultSingleValue singleValue, LookupDefaultMultiValue multiValue) -
addDefaults
public static LookupResult.Builder addDefaults(LookupDefaultSingleValue singleValue, LookupDefaultMultiValue multiValue) -
createFromJSON
-
withoutTTL
-
builder
-