Class ContextMappings

    • Constructor Detail

      • ContextMappings

        public ContextMappings​(java.util.List<ContextMapping<?>> contextMappings)
    • Method Detail

      • size

        public int size()
        number of context mappings held by this instance
      • get

        public ContextMapping<?> get​(java.lang.String name)
        Returns a context mapping by its name
      • addField

        public void addField​(ParseContext.Document document,
                             java.lang.String name,
                             java.lang.String input,
                             int weight,
                             java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> contexts)
        Adds a context-enabled field for all the defined mappings to document see ContextMappings.TypedContextField
      • iterator

        public java.util.Iterator<ContextMapping<?>> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<ContextMapping<?>>
      • toContextQuery

        public toContextQuery​( query,
                                                                                     java.util.Map<java.lang.String,​java.util.List<ContextMapping.InternalQueryContext>> queryContexts)
        Wraps a CompletionQuery with context queries
        query - base completion query to wrap
        queryContexts - a map of context mapping name and collected query contexts
        a context-enabled query
      • getNamedContexts

        public java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> getNamedContexts​(java.util.List<java.lang.CharSequence> contexts)
        Maps an output context list to a map of context mapping names and their values see ContextMappings.TypedContextField
        a map of context names and their values
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        equals in class java.lang.Object