Class DocsumDefinition


  • public class DocsumDefinition
    extends java.lang.Object
    A docsum definition which knows how to decode a certain class of document summaries. The docsum definition has a name and a list of field definitions
    Author:
    bratseth, Bjørn Borud
    • Constructor Summary

      Constructors 
      Constructor Description
      DocsumDefinition​(java.lang.String name, java.util.List<DocsumField> fields)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object convert​(java.lang.String fieldName, com.yahoo.data.access.Inspector value)
      Returns the given slime value as the type specified in this, or null if the type is not known.
      java.util.Set<java.lang.String> fieldNames()  
      DocsumField getField​(int fieldIndex)
      Returns the field at this index, or null if none
      DocsumField getField​(java.lang.String fieldName)
      Returns the field with this name, or null if none
      int getFieldCount()  
      java.util.List<DocsumField> getFields()  
      java.lang.String getName()  
      boolean isDynamic()
      Returns whether this summary contains one or more dynamic fields
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • DocsumDefinition

        public DocsumDefinition​(java.lang.String name,
                                java.util.List<DocsumField> fields)
    • Method Detail

      • getField

        public DocsumField getField​(int fieldIndex)
        Returns the field at this index, or null if none
      • getField

        public DocsumField getField​(java.lang.String fieldName)
        Returns the field with this name, or null if none
      • convert

        public java.lang.Object convert​(java.lang.String fieldName,
                                        com.yahoo.data.access.Inspector value)
        Returns the given slime value as the type specified in this, or null if the type is not known. Even in a correctly configured system we may encounter field names for which we do not know the type, in the time period when a configuration is changing and one node has received the new configuration and another has not.
      • fieldNames

        public java.util.Set<java.lang.String> fieldNames()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getName

        public java.lang.String getName()
      • getFieldCount

        public int getFieldCount()
      • getFields

        public java.util.List<DocsumField> getFields()
      • isDynamic

        public boolean isDynamic()
        Returns whether this summary contains one or more dynamic fields