- java.lang.Object
-
- io.annot8.testing.testimpl.TestItem
-
- All Implemented Interfaces:
io.annot8.core.data.Item,io.annot8.core.helpers.WithGroups,io.annot8.core.helpers.WithId,io.annot8.core.helpers.WithMutableProperties
public class TestItem extends Object implements io.annot8.core.data.Item
-
-
Constructor Summary
Constructors Constructor Description TestItem()TestItem(io.annot8.core.data.ItemFactory itemFactory)TestItem(io.annot8.core.data.ItemFactory itemFactory, io.annot8.core.stores.GroupStore groupStore)TestItem(io.annot8.core.data.ItemFactory itemFactory, io.annot8.core.stores.GroupStore groupStore, io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry)TestItem(io.annot8.core.data.ItemFactory itemFactory, io.annot8.core.stores.GroupStore groupStore, io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry, String parentId)TestItem(io.annot8.core.data.ItemFactory itemFactory, io.annot8.core.stores.GroupStore groupStore, String parentId)TestItem(io.annot8.core.data.ItemFactory itemFactory, String parentId)
-
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(Class<C> clazz)io.annot8.core.data.ItemcreateChildItem()voiddiscard()Map<String,io.annot8.core.data.Content<?>>getContent()Optional<io.annot8.core.data.Content<?>>getContent(String id)io.annot8.common.implementations.registries.ContentBuilderFactoryRegistrygetContentBuilderFactoryRegistry()Stream<io.annot8.core.data.Content<?>>getContents()<T extends io.annot8.core.data.Content<?>>
Stream<T>getContents(Class<T> clazz)io.annot8.core.stores.GroupStoregetGroups()StringgetId()Optional<String>getParent()io.annot8.core.properties.MutablePropertiesgetProperties()booleanisDiscarded()Stream<String>listNames()voidremoveContent(String id)<D,C extends io.annot8.core.data.Content<D>>
Csave(C c)<C extends io.annot8.core.data.Content<D>,D>
Csave(io.annot8.core.data.Content.Builder<C,D> builder)voidsetContent(Map<String,io.annot8.core.data.Content<?>> content)voidsetContentBuilderFactoryRegistry(io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry)voidsetGroups(io.annot8.core.stores.GroupStore groups)voidsetProperties(io.annot8.core.properties.MutableProperties properties)
-
-
-
Constructor Detail
-
TestItem
public TestItem()
-
TestItem
public TestItem(io.annot8.core.data.ItemFactory itemFactory)
-
TestItem
public TestItem(io.annot8.core.data.ItemFactory itemFactory, String parentId)
-
TestItem
public TestItem(io.annot8.core.data.ItemFactory itemFactory, io.annot8.core.stores.GroupStore groupStore)
-
TestItem
public TestItem(io.annot8.core.data.ItemFactory itemFactory, io.annot8.core.stores.GroupStore groupStore, String parentId)
-
TestItem
public TestItem(io.annot8.core.data.ItemFactory itemFactory, io.annot8.core.stores.GroupStore groupStore, io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry)
-
TestItem
public TestItem(io.annot8.core.data.ItemFactory itemFactory, io.annot8.core.stores.GroupStore groupStore, io.annot8.common.implementations.registries.ContentBuilderFactoryRegistry contentBuilderFactoryRegistry, String parentId)
-
-
Method Detail
-
listNames
public Stream<String> listNames()
- Specified by:
listNamesin interfaceio.annot8.core.data.Item
-
getContent
public Optional<io.annot8.core.data.Content<?>> getContent(String id)
- Specified by:
getContentin interfaceio.annot8.core.data.Item
-
getContents
public Stream<io.annot8.core.data.Content<?>> getContents()
- Specified by:
getContentsin interfaceio.annot8.core.data.Item
-
getContents
public <T extends io.annot8.core.data.Content<?>> Stream<T> getContents(Class<T> clazz)
- Specified by:
getContentsin interfaceio.annot8.core.data.Item
-
getId
public String getId()
- Specified by:
getIdin interfaceio.annot8.core.helpers.WithId
-
getParent
public Optional<String> getParent()
- Specified by:
getParentin interfaceio.annot8.core.data.Item
-
create
public <C extends io.annot8.core.data.Content<D>,D> io.annot8.core.data.Content.Builder<C,D> create(Class<C> clazz) throws io.annot8.core.exceptions.UnsupportedContentException
- Specified by:
createin interfaceio.annot8.core.data.Item- 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(String id)
- Specified by:
removeContentin interfaceio.annot8.core.data.Item
-
getGroups
public io.annot8.core.stores.GroupStore getGroups()
- Specified by:
getGroupsin interfaceio.annot8.core.helpers.WithGroups
-
setGroups
public void setGroups(io.annot8.core.stores.GroupStore groups)
-
getProperties
public io.annot8.core.properties.MutableProperties getProperties()
- Specified by:
getPropertiesin interfaceio.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)
-
createChildItem
public io.annot8.core.data.Item createChildItem()
- Specified by:
createChildItemin interfaceio.annot8.core.data.Item
-
discard
public void discard()
- Specified by:
discardin interfaceio.annot8.core.data.Item
-
isDiscarded
public boolean isDiscarded()
- Specified by:
isDiscardedin interfaceio.annot8.core.data.Item
-
-