Class ColumnPattern<T,​U>

java.lang.Object
bayern.steinbrecher.dbConnector.scheme.ColumnPattern<T,​U>
Type Parameters:
T - The datatype of the values stored in the column.
U - The type of objects the content of this column belongs to.
Direct Known Subclasses:
RegexColumnPattern, SimpleColumnPattern

public abstract class ColumnPattern<T,​U>
extends java.lang.Object
Since:
0.1
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected ColumnPattern​(@NotNull java.lang.String columnNamePattern, @NotNull ColumnParser<T> parser)  
  • Method Summary

    Modifier and Type Method Description
    U combine​(U toSet, @NotNull java.lang.String columnName, @Nullable java.lang.String value)
    Parses the given value and sets it to the object of type ColumnPattern.
    protected abstract U combineImpl​(U toSet, @NotNull java.lang.String columnName, T parsedValue)  
    boolean equals​(@Nullable java.lang.Object obj)
    Checks whether this pattern reflects the same column names as the given object.
    @NotNull java.util.regex.Pattern getColumnNamePattern()  
    @NotNull ColumnParser<T> getParser()  
    int hashCode()  
    boolean matches​(@NotNull java.lang.String columnName)  
    @NotNull java.lang.String toString()  

    Methods inherited from class java.lang.Object

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

    • ColumnPattern

      protected ColumnPattern​(@NotNull @NotNull java.lang.String columnNamePattern, @NotNull @NotNull ColumnParser<T> parser)
      Parameters:
      columnNamePattern - The RegEx column names have to match.
      parser - The parser for converting values from and to their SQL representation.
      Since:
      0.1
  • Method Details

    • getColumnNamePattern

      @NotNull public @NotNull java.util.regex.Pattern getColumnNamePattern()
      Since:
      0.1
    • matches

      public boolean matches​(@NotNull @NotNull java.lang.String columnName)
      Since:
      0.1
    • getParser

      @NotNull public @NotNull ColumnParser<T> getParser()
      Since:
      0.1
    • combine

      public final U combine​(@NotNull U toSet, @NotNull @NotNull java.lang.String columnName, @Nullable @Nullable java.lang.String value)
      Parses the given value and sets it to the object of type ColumnPattern.
      Parameters:
      toSet - The object to set the parsed value to.
      columnName - The column name matching this pattern to extract the key from.
      value - The value to parse and to set.
      Returns:
      The resulting object of type ColumnPattern.
      Since:
      0.1
    • combineImpl

      protected abstract U combineImpl​(@NotNull U toSet, @NotNull @NotNull java.lang.String columnName, @Nullable T parsedValue)
      Since:
      0.1
      See Also:
      combine(Object, String, String)
    • equals

      public boolean equals​(@Nullable @Nullable java.lang.Object obj)
      Checks whether this pattern reflects the same column names as the given object. NOTE It is only checked whether their regex are identical not whether they express the same column names.
      Overrides:
      equals in class java.lang.Object
      Parameters:
      obj - The object to compare this column pattern with.
      Returns:
      true only if this pattern reflects the same column names as the given object.
      Since:
      0.1
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
      Since:
      0.1
    • toString

      @NotNull public @NotNull java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
      Since:
      0.1