Class DefaultItem

  • All Implemented Interfaces:
    io.annot8.core.data.BaseItem, io.annot8.core.helpers.WithGroups, io.annot8.core.helpers.WithId, io.annot8.core.helpers.WithMutableProperties


    public class DefaultItem
    extends java.lang.Object
    implements io.annot8.core.data.BaseItem
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultItem​(io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry)  
      DefaultItem​(java.lang.String parentId, io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <C extends io.annot8.core.data.Content<D>,D>
      io.annot8.core.data.Content.Builder<C,D>
      create​(java.lang.Class<C> clazz)  
      void discard​()  
      java.util.Optional<io.annot8.core.data.Content<?>> getContent​(java.lang.String id)  
      java.util.stream.Stream<io.annot8.core.data.Content<?>> getContents​()  
      io.annot8.core.stores.GroupStore getGroups​()  
      java.lang.String getId​()  
      java.util.Optional<java.lang.String> getParent​()  
      io.annot8.core.properties.MutableProperties getProperties​()  
      boolean isDiscarded​()  
      void removeContent​(java.lang.String name)  
      • Methods inherited from interface io.annot8.core.data.BaseItem

        getContentByName, getContents, hasContentOfName, hasParent, listNames
      • Methods inherited from class java.lang.Object

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

      • DefaultItem

        public DefaultItem​(java.lang.String parentId,
                           io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry)
      • DefaultItem

        public DefaultItem​(io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry)
    • Method Detail

      • getParent

        public java.util.Optional<java.lang.String> getParent​()
        Specified by:
        getParent in interface io.annot8.core.data.BaseItem
      • getContent

        public java.util.Optional<io.annot8.core.data.Content<?>> getContent​(java.lang.String id)
        Specified by:
        getContent in interface io.annot8.core.data.BaseItem
      • getContents

        public java.util.stream.Stream<io.annot8.core.data.Content<?>> getContents​()
        Specified by:
        getContents in interface io.annot8.core.data.BaseItem
      • create

        public <C extends io.annot8.core.data.Content<D>,D> io.annot8.core.data.Content.Builder<C,D> create​(java.lang.Class<C> clazz)
                                                                                                     throws io.annot8.core.exceptions.UnsupportedContentException
        Specified by:
        create in interface io.annot8.core.data.BaseItem
        Throws:
        io.annot8.core.exceptions.UnsupportedContentException
      • removeContent

        public void removeContent​(java.lang.String name)
        Specified by:
        removeContent in interface io.annot8.core.data.BaseItem
      • getGroups

        public io.annot8.core.stores.GroupStore getGroups​()
        Specified by:
        getGroups in interface io.annot8.core.helpers.WithGroups
      • getProperties

        public io.annot8.core.properties.MutableProperties getProperties​()
        Specified by:
        getProperties in interface io.annot8.core.helpers.WithMutableProperties
      • discard

        public void discard​()
        Specified by:
        discard in interface io.annot8.core.data.BaseItem
      • isDiscarded

        public boolean isDiscarded​()
        Specified by:
        isDiscarded in interface io.annot8.core.data.BaseItem
      • getId

        public java.lang.String getId​()
        Specified by:
        getId in interface io.annot8.core.helpers.WithId