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.

public class AspectBuilder<V extends IValue,T extends IValueType<V>,O> extends Object
Immutable builder for aspects.
  • Method Details

    • handle

      public <O2> AspectBuilder<V,T,O2> handle(IAspectValuePropagator<O,O2> valuePropagator)
      Add the given value propagator.
      Type Parameters:
      O2 - The new output type.
      Parameters:
      valuePropagator - The value propagator.
      Returns:
      The new builder instance.
    • handle

      public <O2> AspectBuilder<V,T,O2> handle(IAspectValuePropagator<O,O2> valuePropagator, String kind)
      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

      public AspectBuilder<V,T,O> appendKind(String kind)
      Add the given kind.
      Parameters:
      kind - The kind to append.
      Returns:
      The new builder instance.
    • withProperties

      public AspectBuilder<V,T,O> withProperties(IAspectProperties aspectProperties)
      Set the given default aspect properties.
      Parameters:
      aspectProperties - The aspect properties.
      Returns:
      The new builder instance.
    • appendActivator

      public AspectBuilder<V,T,O> appendActivator(IAspectWriteActivator activator)
      Add the given aspect activator. Only applicable for writers.
      Parameters:
      activator - The aspect activator callback.
      Returns:
      The new builder instance.
    • appendDeactivator

      public AspectBuilder<V,T,O> appendDeactivator(IAspectWriteDeactivator deactivator)
      Add the given aspect deactivator. Only applicable for writers.
      Parameters:
      deactivator - The aspect deactivator callback.
      Returns:
      The new builder instance.
    • byMod

      public AspectBuilder<V,T,O> byMod(org.cyclops.cyclopscore.init.ModBase mod)
      Set the mod that provides the aspect.
      Parameters:
      mod - The mod.
      Returns:
      The new builder instance.
    • appendBeforeUpdateListener

      public AspectBuilder<V,T,O> appendBeforeUpdateListener(IAspectUpdateListener.Before listener)
      Add a before-update listener.
      Parameters:
      listener - The listener.
      Returns:
      The new builder instance.
    • appendAfterUpdateListener

      public AspectBuilder<V,T,O> appendAfterUpdateListener(IAspectUpdateListener.After listener)
      Add an after-update listener.
      Parameters:
      listener - The listener.
      Returns:
      The new builder instance.
    • withUpdateType

      public AspectBuilder<V,T,O> withUpdateType(AspectUpdateType updateType)
      Set the update type of the reader aspect.
      Parameters:
      updateType - The update type.
      Returns:
      The new builder instance.
    • buildRead

      public IAspectRead<V,T> buildRead()
      Returns:
      The built read aspect.
    • buildWrite

      public IAspectWrite<V,T> buildWrite()
      Returns:
      The built write aspect.
    • forReadType

      public 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.
      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,org.apache.commons.lang3.tuple.Triple<PartTarget,IAspectProperties,IVariable<V>>> forWriteType(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.