public final class SlotValueWrapper extends Object
Modifier and Type | Method and Description |
---|---|
Optional<ListSlotValue> |
asList()
If the underlying slot type is a
ListSlotValue , returns an Optional containing it. |
Optional<SimpleSlotValue> |
asSimple()
If the underlying slot type is a
SimpleSlotValue , returns an Optional containing it. |
static SlotValueWrapper |
createFrom(SlotValue slotValue)
Creates a wrapper instance wrapping the given
SlotValue . |
boolean |
equals(Object o) |
int |
hashCode() |
SlotValue |
unwrap()
Returns the underlying
SlotValue this instance wraps. |
List<SlotValueWrapper> |
values()
If the underlying slot value is a
ListSlotValue type, returns a List containing
all its values wrapped with SlotValueWrappers. |
public static SlotValueWrapper createFrom(SlotValue slotValue)
SlotValue
.slotValue
- slot value to wrappublic SlotValue unwrap()
SlotValue
this instance wraps.SlotValue
.public List<SlotValueWrapper> values()
ListSlotValue
type, returns a List
containing
all its values wrapped with SlotValueWrappers. If the underlying value is not a list type,
returns a singleton list containing the current wrapper.ListSlotValue
values wrapped in SlotValueWrappers
or a singleton list consisting of the current wrapper.public Optional<SimpleSlotValue> asSimple()
SimpleSlotValue
, returns an Optional
containing it.
If not, returns an Optional
empty.SimpleSlotValue
or Optional
empty.public Optional<ListSlotValue> asList()
ListSlotValue
, returns an Optional
containing it.
If not, returns an Optional
empty.ListSlotValue
or Optional
empty.Copyright © 2023. All rights reserved.