Package org.spongepowered.api.data.value
Interface SetValue<E>
-
- All Superinterfaces:
CollectionValue<E,Set<E>>
,Iterable<E>
,Value<Set<E>>
- All Known Subinterfaces:
SetValue.Immutable<E>
,SetValue.Mutable<E>
public interface SetValue<E> extends CollectionValue<E,Set<E>>
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SetValue.Immutable<E>
Represents a type ofCollectionValue.Immutable
backed by aSet
.static interface
SetValue.Mutable<E>
Represents a type ofCollectionValue.Mutable
backed by aSet
.-
Nested classes/interfaces inherited from interface org.spongepowered.api.data.value.Value
Value.Factory
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description SetValue.Immutable<E>
asImmutable()
Retrieves an immutable form of this value.SetValue.Mutable<E>
asMutable()
Retrieves a mutable form of this value.SetValue.Mutable<E>
asMutableCopy()
Retrieves a copy in the mutable form of this value.static <E> SetValue.Immutable<E>
immutableOf(Supplier<? extends Key<? extends SetValue<E>>> key, Set<E> element)
static <E> SetValue.Immutable<E>
immutableOf(Key<? extends SetValue<E>> key, Set<E> element)
Key<? extends SetValue<E>>
key()
Gets the key for thisValue
.static <E> SetValue.Mutable<E>
mutableOf(Supplier<? extends Key<? extends SetValue<E>>> key, Set<E> element)
static <E> SetValue.Mutable<E>
mutableOf(Key<? extends SetValue<E>> key, Set<E> element)
-
Methods inherited from interface org.spongepowered.api.data.value.CollectionValue
all, contains, containsAll, isEmpty, size
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
mutableOf
static <E> SetValue.Mutable<E> mutableOf(Key<? extends SetValue<E>> key, Set<E> element)
- Type Parameters:
E
- The element type- Parameters:
key
- The keyelement
- The element- Returns:
- The constructed mutable value
-
mutableOf
static <E> SetValue.Mutable<E> mutableOf(Supplier<? extends Key<? extends SetValue<E>>> key, Set<E> element)
- Type Parameters:
E
- The element type- Parameters:
key
- The keyelement
- The element- Returns:
- The constructed mutable value
-
immutableOf
static <E> SetValue.Immutable<E> immutableOf(Key<? extends SetValue<E>> key, Set<E> element)
- Type Parameters:
E
- The element type- Parameters:
key
- The keyelement
- The element- Returns:
- The constructed immutable value
-
immutableOf
static <E> SetValue.Immutable<E> immutableOf(Supplier<? extends Key<? extends SetValue<E>>> key, Set<E> element)
- Type Parameters:
E
- The element type- Parameters:
key
- The keyelement
- The element- Returns:
- The constructed immutable value
-
key
Key<? extends SetValue<E>> key()
Description copied from interface:Value
Gets the key for thisValue
.
-
asMutable
SetValue.Mutable<E> asMutable()
Description copied from interface:Value
Retrieves a mutable form of this value. Due to the vague nature of the value itself, some cases can already provide aValue.Mutable
instance where this would simply return itself. In other cases, where the retrieved value is anValue.Immutable
instance, a new mutable value is created with the same key and values.
-
asMutableCopy
SetValue.Mutable<E> asMutableCopy()
Description copied from interface:Value
Retrieves a copy in the mutable form of this value. The new is created with the same key and values.- Specified by:
asMutableCopy
in interfaceCollectionValue<E,Set<E>>
- Specified by:
asMutableCopy
in interfaceValue<E>
- Returns:
- A mutable value
-
asImmutable
SetValue.Immutable<E> asImmutable()
Description copied from interface:Value
Retrieves an immutable form of this value. Due to the vague nature of the value itself, some cases can already provide aValue.Immutable
instance where this would simply return itself. In other cases, where the retrieved value is aValue.Mutable
instance, a new immutable value is created with the same key and values.- Specified by:
asImmutable
in interfaceCollectionValue<E,Set<E>>
- Specified by:
asImmutable
in interfaceValue<E>
- Returns:
- An immutable value
-
-