Class TestItem

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


    public class TestItem
    extends java.lang.Object
    implements io.annot8.core.data.Item
    • Constructor Summary

      Constructors 
      Constructor Description
      TestItem​()  
      TestItem​(io.annot8.core.data.ItemFactory itemFactory, io.annot8.core.stores.GroupStore groupStore, io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry, java.lang.String parentId)  
      TestItem​(io.annot8.core.stores.GroupStore groupStore)  
      TestItem​(io.annot8.core.stores.GroupStore groupStore, io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry)  
      TestItem​(io.annot8.core.stores.GroupStore groupStore, io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry, java.lang.String parentId)  
      TestItem​(io.annot8.core.stores.GroupStore groupStore, java.lang.String parentId)  
      TestItem​(java.lang.String parentId)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.annot8.core.data.Item create​()  
      <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.Map<java.lang.String,io.annot8.core.data.Content<?>> getContent​()  
      java.util.Optional<io.annot8.core.data.Content<?>> getContent​(java.lang.String id)  
      io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry getContentBuilderFactoryRegistry​()  
      java.util.stream.Stream<io.annot8.core.data.Content<?>> getContents​()  
      <T extends io.annot8.core.data.Content<?>>
      java.util.stream.Stream<T>
      getContents​(java.lang.Class<T> clazz)  
      io.annot8.core.stores.GroupStore getGroups​()  
      java.lang.String getId​()  
      io.annot8.core.data.ItemFactory getItemFactory​()  
      java.util.Optional<java.lang.String> getParent​()  
      io.annot8.core.properties.MutableProperties getProperties​()  
      boolean isDiscarded​()  
      java.util.stream.Stream<java.lang.String> listNames​()  
      void removeContent​(java.lang.String id)  
      <D,C extends io.annot8.core.data.Content<D>>
      C
      save​(C c)  
      <C extends io.annot8.core.data.Content<D>,D>
      C
      save​(io.annot8.core.data.Content.Builder<C,D> builder)  
      void setContent​(java.util.Map<java.lang.String,io.annot8.core.data.Content<?>> content)  
      void setContentBuilderFactoryRegistry​(io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry)  
      void setGroups​(io.annot8.core.stores.GroupStore groups)  
      void setProperties​(io.annot8.core.properties.MutableProperties properties)  
      • Methods inherited from interface io.annot8.core.data.BaseItem

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

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

      • TestItem

        public TestItem​()
      • TestItem

        public TestItem​(java.lang.String parentId)
      • TestItem

        public TestItem​(io.annot8.core.stores.GroupStore groupStore)
      • TestItem

        public TestItem​(io.annot8.core.stores.GroupStore groupStore,
                        java.lang.String parentId)
      • TestItem

        public TestItem​(io.annot8.core.stores.GroupStore groupStore,
                        io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry)
      • TestItem

        public TestItem​(io.annot8.core.stores.GroupStore groupStore,
                        io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry,
                        java.lang.String parentId)
      • TestItem

        public TestItem​(io.annot8.core.data.ItemFactory itemFactory,
                        io.annot8.core.stores.GroupStore groupStore,
                        io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry,
                        java.lang.String parentId)
    • Method Detail

      • listNames

        public java.util.stream.Stream<java.lang.String> listNames​()
        Specified by:
        listNames 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
      • getContents

        public <T extends io.annot8.core.data.Content<?>> java.util.stream.Stream<T> getContents​(java.lang.Class<T> clazz)
        Specified by:
        getContents in interface io.annot8.core.data.BaseItem
      • getId

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

        public java.util.Optional<java.lang.String> getParent​()
        Specified by:
        getParent 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
      • save

        public <C extends io.annot8.core.data.Content<D>,D> C save​(io.annot8.core.data.Content.Builder<C,D> builder)
                                                            throws io.annot8.core.exceptions.AlreadyExistsException
        Throws:
        io.annot8.core.exceptions.AlreadyExistsException
      • save

        public <D,C extends io.annot8.core.data.Content<D>> C save​(C c)
      • removeContent

        public void removeContent​(java.lang.String id)
        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
      • setGroups

        public void setGroups​(io.annot8.core.stores.GroupStore groups)
      • getProperties

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

        public void setProperties​(io.annot8.core.properties.MutableProperties properties)
      • getContentBuilderFactoryRegistry

        public io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry getContentBuilderFactoryRegistry​()
      • setContentBuilderFactoryRegistry

        public void setContentBuilderFactoryRegistry​(io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry)
      • getContent

        public java.util.Map<java.lang.String,io.annot8.core.data.Content<?>> getContent​()
      • setContent

        public void setContent​(java.util.Map<java.lang.String,io.annot8.core.data.Content<?>> content)
      • 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
      • create

        public io.annot8.core.data.Item create​()
        Specified by:
        create in interface io.annot8.core.data.Item
      • getItemFactory

        public io.annot8.core.data.ItemFactory getItemFactory​()