Class AppendableValueRW<T>

java.lang.Object
org.bsc.langgraph4j.state.AppendableValueRW<T>
Type Parameters:
T - the type of the value
All Implemented Interfaces:
Externalizable, Serializable, AppendableValue<T>

@Deprecated(forRemoval=true) public class AppendableValueRW<T> extends Object implements AppendableValue<T>, Externalizable
Deprecated, for removal: This API element is subject to removal in a future version.
A class that implements the AppendableValue interface and provides functionality to append values to a list and retrieve various properties of the list.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs an AppendableValueRW with an empty list of values.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs an AppendableValueRW with the given initial collection of values.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    append(Object value)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Appends a value or a collection of values to the list.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks if the list of values is empty.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the last value in the list, if present.
    lastMinus(int n)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the value at the specified position from the end of the list, if present.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the size of the list of values.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a string representation of the list of values.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns an unmodifiable list of values.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AppendableValueRW

      public AppendableValueRW(Collection<T> values)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs an AppendableValueRW with the given initial collection of values.
      Parameters:
      values - the initial collection of values
    • AppendableValueRW

      public AppendableValueRW()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs an AppendableValueRW with an empty list of values.
  • Method Details

    • append

      public void append(Object value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Appends a value or a collection of values to the list.
      Parameters:
      value - the value or collection of values to append
    • values

      public List<T> values()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns an unmodifiable list of values.
      Specified by:
      values in interface AppendableValue<T>
      Returns:
      an unmodifiable list of values
    • isEmpty

      public boolean isEmpty()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks if the list of values is empty.
      Specified by:
      isEmpty in interface AppendableValue<T>
      Returns:
      true if the list of values is empty, false otherwise
    • size

      public int size()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the size of the list of values.
      Specified by:
      size in interface AppendableValue<T>
      Returns:
      the size of the list of values
    • last

      public Optional<T> last()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the last value in the list, if present.
      Specified by:
      last in interface AppendableValue<T>
      Returns:
      an Optional containing the last value if present, otherwise an empty Optional
    • lastMinus

      public Optional<T> lastMinus(int n)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value at the specified position from the end of the list, if present.
      Specified by:
      lastMinus in interface AppendableValue<T>
      Parameters:
      n - the position from the end of the list
      Returns:
      an Optional containing the value at the specified position if present, otherwise an empty Optional
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a string representation of the list of values.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the list of values
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException