public class Injectable extends Object
Note: This class is not a part of the public API and is subject to change. Do not use it in your own code
Modifier and Type | Field and Description |
---|---|
static Injectable |
EMPTY |
Modifier and Type | Method and Description |
---|---|
static Injectable |
fallback(Object value)
Creates a fallback
Defaultable instance with the specified value |
Object |
getValue()
Retrieves the value
|
boolean |
isDefault()
Gets whether the contained value is null, empty, or is an explicitly declared fallback
|
static boolean |
isNotDefault(Object value)
Gets whether the provided object is not a
Defaultable instance in the "fallback" state. |
static Injectable |
of(Object value)
Creates a non-fallback
Defaultable instance with the specified value |
static Object |
unwrap(Object value)
Extracts the value from the provided reference that can be a
Injectable wrapper |
public static final Injectable EMPTY
public static Injectable fallback(Object value)
Defaultable
instance with the specified valuevalue
- Value to setDefaultable
instancepublic Object getValue()
public boolean isDefault()
public static boolean isNotDefault(Object value)
Defaultable
instance in the "fallback" state. A null
is
considered a default value as well. This check is usually needed to place a value into an injectable array or
collectionvalue
- Value to checkpublic static Injectable of(Object value)
Defaultable
instance with the specified valuevalue
- Value to setDefaultable
instancepublic static Object unwrap(Object value)
Injectable
wrappervalue
- Extraction sourceCopyright © 2024 Exadel, Inc.. All rights reserved.