Class DefaultModifiableServiceProperty<I,T>
- java.lang.Object
-
- de.dytanic.cloudnet.driver.service.property.DefaultModifiableServiceProperty<I,T>
-
- All Implemented Interfaces:
ServiceProperty<T>
public class DefaultModifiableServiceProperty<I,T> extends java.lang.Object implements ServiceProperty<T>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull java.util.Optional<T>get(@NotNull ServiceInfoSnapshot serviceInfoSnapshot)Gets a property out of the properties of the givenServiceInfoSnapshot.DefaultModifiableServiceProperty<I,T>modifyGet(java.util.function.BiFunction<ServiceInfoSnapshot,I,T> getModifier)DefaultModifiableServiceProperty<I,T>modifySet(java.util.function.BiFunction<ServiceInfoSnapshot,T,I> setModifier)voidset(@NotNull ServiceInfoSnapshot serviceInfoSnapshot, T value)Sets a property into the properties of the givenServiceInfoSnapshot.static <I,T>
DefaultModifiableServiceProperty<I,T>wrap(ServiceProperty<I> wrapped)
-
-
-
Method Detail
-
wrap
public static <I,T> DefaultModifiableServiceProperty<I,T> wrap(ServiceProperty<I> wrapped)
-
modifyGet
public DefaultModifiableServiceProperty<I,T> modifyGet(java.util.function.BiFunction<ServiceInfoSnapshot,I,T> getModifier)
-
modifySet
public DefaultModifiableServiceProperty<I,T> modifySet(java.util.function.BiFunction<ServiceInfoSnapshot,T,I> setModifier)
-
get
@NotNull public @NotNull java.util.Optional<T> get(@NotNull @NotNull ServiceInfoSnapshot serviceInfoSnapshot)
Description copied from interface:ServicePropertyGets a property out of the properties of the givenServiceInfoSnapshot.- Specified by:
getin interfaceServiceProperty<I>- Parameters:
serviceInfoSnapshot- the serviceInfoSnapshot to get the property- Returns:
- an optional with the value, might be empty
-
set
public void set(@NotNull @NotNull ServiceInfoSnapshot serviceInfoSnapshot, @Nullable T value)Description copied from interface:ServicePropertySets a property into the properties of the givenServiceInfoSnapshot. Some properties might not support this. An update of the service might be necessary.- Specified by:
setin interfaceServiceProperty<I>- Parameters:
serviceInfoSnapshot- the serviceInfoSnapshot to modify the property invalue- the value to set or null to remove the property
-
-