Class AspectBuilder<V extends IValue,T extends IValueType<V>,O>
java.lang.Object
org.cyclops.integrateddynamics.core.part.aspect.build.AspectBuilder<V,T,O>
- Type Parameters:
V
- The value type.T
- The value type type.O
- The current output type for value handling.
Immutable builder for aspects.
-
Method Summary
Modifier and TypeMethodDescriptionAspectBuilder<V,
T, O> appendActivator
(IAspectWriteActivator activator) Add the given aspect activator.AspectBuilder<V,
T, O> Add an after-update listener.AspectBuilder<V,
T, O> Add a before-update listener.AspectBuilder<V,
T, O> appendDeactivator
(IAspectWriteDeactivator deactivator) Add the given aspect deactivator.AspectBuilder<V,
T, O> appendKind
(String kind) Add the given kind.AspectBuilder<V,
T, O> byMod
(org.cyclops.cyclopscore.init.ModBase mod) Set the mod that provides the aspect.static <V extends IValue,
T extends IValueType<V>>
AspectBuilder<V,T, org.apache.commons.lang3.tuple.Pair<PartTarget, IAspectProperties>> forReadType
(T valueType) Create a new read builder for the given value type.static <V extends IValue,
T extends IValueType<V>>
AspectBuilder<V,T, org.apache.commons.lang3.tuple.Triple<PartTarget, IAspectProperties, IVariable<V>>> forWriteType
(T valueType) Create a new write builder for the given value type.<O2> AspectBuilder<V,
T, O2> handle
(IAspectValuePropagator<O, O2> valuePropagator) Add the given value propagator.<O2> AspectBuilder<V,
T, O2> handle
(IAspectValuePropagator<O, O2> valuePropagator, String kind) Add the given value propagator.AspectBuilder<V,
T, O> withProperties
(IAspectProperties aspectProperties) Set the given default aspect properties.AspectBuilder<V,
T, O> withUpdateType
(AspectUpdateType updateType) Set the update type of the reader aspect.
-
Method Details
-
handle
Add the given value propagator.- Type Parameters:
O2
- The new output type.- Parameters:
valuePropagator
- The value propagator.- Returns:
- The new builder instance.
-
handle
Add the given value propagator.- Type Parameters:
O2
- The new output type.- Parameters:
valuePropagator
- The value propagator.kind
- The kind to append.- Returns:
- The new builder instance.
-
appendKind
Add the given kind.- Parameters:
kind
- The kind to append.- Returns:
- The new builder instance.
-
withProperties
Set the given default aspect properties.- Parameters:
aspectProperties
- The aspect properties.- Returns:
- The new builder instance.
-
appendActivator
Add the given aspect activator. Only applicable for writers.- Parameters:
activator
- The aspect activator callback.- Returns:
- The new builder instance.
-
appendDeactivator
Add the given aspect deactivator. Only applicable for writers.- Parameters:
deactivator
- The aspect deactivator callback.- Returns:
- The new builder instance.
-
byMod
Set the mod that provides the aspect.- Parameters:
mod
- The mod.- Returns:
- The new builder instance.
-
appendBeforeUpdateListener
Add a before-update listener.- Parameters:
listener
- The listener.- Returns:
- The new builder instance.
-
appendAfterUpdateListener
Add an after-update listener.- Parameters:
listener
- The listener.- Returns:
- The new builder instance.
-
withUpdateType
Set the update type of the reader aspect.- Parameters:
updateType
- The update type.- Returns:
- The new builder instance.
-
buildRead
- Returns:
- The built read aspect.
-
buildWrite
- Returns:
- The built write aspect.
-
forReadType
public static <V extends IValue,T extends IValueType<V>> AspectBuilder<V,T, forReadTypeorg.apache.commons.lang3.tuple.Pair<PartTarget, IAspectProperties>> (T valueType) Create a new read builder for the given value type.- Type Parameters:
V
- The value type.T
- The value type type.- Parameters:
valueType
- The value type the eventual built aspect will output.- Returns:
- The builder instance.
-
forWriteType
public static <V extends IValue,T extends IValueType<V>> AspectBuilder<V,T, forWriteTypeorg.apache.commons.lang3.tuple.Triple<PartTarget, IAspectProperties, IVariable<V>>> (T valueType) Create a new write builder for the given value type.- Type Parameters:
V
- The value type.T
- The value type type.- Parameters:
valueType
- The value type the eventual built aspect expects.- Returns:
- The builder instance.
-