Class TestItem

  • All Implemented Interfaces:
    io.annot8.api.data.Item, io.annot8.api.helpers.WithFilter<io.annot8.api.data.Content<?>>, io.annot8.api.helpers.WithGroups, io.annot8.api.helpers.WithId, io.annot8.api.helpers.WithMutableProperties

    public class TestItem
    extends Object
    implements io.annot8.api.data.Item
    • Constructor Detail

      • TestItem

        public TestItem()
      • TestItem

        public TestItem​(String parentId)
      • TestItem

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

        public TestItem​(io.annot8.api.stores.GroupStore groupStore,
                        String parentId)
      • TestItem

        public TestItem​(io.annot8.api.data.ItemFactory itemFactory,
                        io.annot8.api.stores.GroupStore groupStore,
                        ContentBuilderFactoryRegistry contentBuilderFactoryRegistry,
                        String parentId)
    • Method Detail

      • getContent

        public Optional<io.annot8.api.data.Content<?>> getContent​(String id)
        Specified by:
        getContent in interface io.annot8.api.data.Item
      • getContents

        public Stream<io.annot8.api.data.Content<?>> getContents()
        Specified by:
        getContents in interface io.annot8.api.data.Item
      • getContents

        public <T extends io.annot8.api.data.Content<?>> Stream<T> getContents​(Class<T> clazz)
        Specified by:
        getContents in interface io.annot8.api.data.Item
      • getId

        public String getId()
        Specified by:
        getId in interface io.annot8.api.helpers.WithId
      • getParent

        public Optional<String> getParent()
        Specified by:
        getParent in interface io.annot8.api.data.Item
      • createContent

        public <C extends io.annot8.api.data.Content<D>,​D> io.annot8.api.data.Content.Builder<C,​D> createContent​(Class<C> clazz)
        Specified by:
        createContent in interface io.annot8.api.data.Item
      • save

        public <C extends io.annot8.api.data.Content<D>,​D> C save​(io.annot8.api.data.Content.Builder<C,​D> builder)
      • save

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

        public void removeContent​(String id)
        Specified by:
        removeContent in interface io.annot8.api.data.Item
      • getGroups

        public io.annot8.api.stores.GroupStore getGroups()
        Specified by:
        getGroups in interface io.annot8.api.helpers.WithGroups
      • setGroups

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

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

        public void setProperties​(io.annot8.api.properties.MutableProperties properties)
      • setContentBuilderFactoryRegistry

        public void setContentBuilderFactoryRegistry​(ContentBuilderFactoryRegistry contentBuilderFactoryRegistry)
      • getContent

        public Map<String,​io.annot8.api.data.Content<?>> getContent()
      • setContent

        public void setContent​(Map<String,​io.annot8.api.data.Content<?>> content)
      • discard

        public void discard()
        Specified by:
        discard in interface io.annot8.api.data.Item
      • isDiscarded

        public boolean isDiscarded()
        Specified by:
        isDiscarded in interface io.annot8.api.data.Item
      • createChild

        public io.annot8.api.data.Item createChild()
        Specified by:
        createChild in interface io.annot8.api.data.Item
      • getItemFactory

        public io.annot8.api.data.ItemFactory getItemFactory()