Interface TupleBridge<D,C>

Type Parameters:
D - The domain type of the tuple like object
C - The component type
All Superinterfaces:
TupleAccessor<D,C>
All Known Subinterfaces:
GenericTupleAccessor<D,C,K>, TupleBridge3<D,C>, TupleBridge4<D,C>, TupleMutator<DomainType,ComponentType>
All Known Implementing Classes:
GenericTupleAccessorForMap, GenericTupleAccessorFromListOfKeysBase, TupleAccessorForArrayOfInts, TupleAccessorForList, TupleAccessorRemap

public interface TupleBridge<D,C> extends TupleAccessor<D,C>
A bridge between domain objects and tuple representation. The bridge adds the capability to create domain objects from tuples.
Author:
Claus Stadler 11/09/2020
  • Method Summary

    Modifier and Type
    Method
    Description
    default D
    build(C... components)
     
    <T> D
    build(T obj, TupleAccessor<? super T,? extends C> accessor)
    Build a domain object from some tuple-like object with its corresponding accessor.
    default Object
    compact(D domainObject)
    If the dimension is 1 then return the component, otherwise the tuple.
    int
     
    default C[]
    toComponentArray(D domainObject)
    If dimension == 1 then return the object as is, otherwise interpret it as a domain tuple.
    default void
     

    Methods inherited from interface org.aksw.commons.tuple.accessor.TupleAccessor

    get, map
  • Method Details

    • getDimension

      int getDimension()
    • build

      <T> D build(T obj, TupleAccessor<? super T,? extends C> accessor)
      Build a domain object from some tuple-like object with its corresponding accessor.
    • build

      default D build(C... components)
    • validateBuildArg

      default void validateBuildArg(TupleBridge<?,?> bridge)
    • compact

      default Object compact(D domainObject)
      If the dimension is 1 then return the component, otherwise the tuple.
    • toComponentArray

      default C[] toComponentArray(D domainObject)
      If dimension == 1 then return the object as is, otherwise interpret it as a domain tuple.