public enum CoreUtils extends Enum<CoreUtils> implements InitializeListener
ParaObject| Enum Constant and Description |
|---|
INSTANCE
Singleton.
|
| Modifier and Type | Method and Description |
|---|---|
abstract List<String> |
addTags(List<String> objectTags,
String... tag)
Adds any number of tags to the set of tags.
|
abstract Long |
countChildren(ParaObject obj,
String type2)
Count the total number of child objects for this object.
|
abstract Long |
countLinks(ParaObject obj,
String type2)
Count the total number of links between this object and another type of object.
|
abstract void |
deleteChildren(ParaObject obj,
String type2)
Deletes all child objects permanently.
|
abstract <P extends ParaObject> |
findChildren(ParaObject obj,
String type2,
String query,
Pager... pager)
Searches through child objects in a one-to-many relationship.
|
abstract <P extends ParaObject> |
findLinkedObjects(ParaObject obj,
String type2,
String field,
String query,
Pager... pager)
Searches through all linked objects in many-to-many relationships.
|
abstract Cache |
getCache()
Returns the Cache object.
|
abstract <P extends ParaObject> |
getChildren(ParaObject obj,
String type2,
Pager... pager)
Returns all child objects linked to this object.
|
abstract <P extends ParaObject> |
getChildren(ParaObject obj,
String type2,
String field,
String term,
Pager... pager)
Returns all child objects linked to this object.
|
abstract <P extends ParaObject> |
getCreator(ParaObject obj)
The user object of the creator.
|
abstract DAO |
getDao()
Returns the DAO object.
|
static CoreUtils |
getInstance()
Provides a default instance using fake DAO, Search and Cache implementations.
|
abstract IoTServiceFactory |
getIotFactory()
Returns the default IoT factory.
|
abstract <P extends ParaObject> |
getLinkedObjects(ParaObject obj,
String type2,
Pager... pager)
Returns all objects linked to the given one.
|
abstract List<Linker> |
getLinks(ParaObject obj,
String type2,
Pager... pager)
Returns a list of all Linker objects for a given object.
|
abstract String |
getName(String name,
String id)
Returns the default name property of an object.
|
abstract String |
getObjectURI(ParaObject obj)
Returns the relative path to the object, e.g.
|
abstract <P extends ParaObject> |
getParent(ParaObject obj)
The parent object.
|
abstract Search |
getSearch()
Returns the Search object.
|
abstract boolean |
isLinked(ParaObject obj,
ParaObject toObj)
Checks if a given object is linked to this one.
|
abstract boolean |
isLinked(ParaObject obj,
String type2,
String id2)
Checks if this object is linked to another.
|
abstract String |
link(ParaObject obj,
String id2)
Links an object to this one in a many-to-many relationship.
|
abstract String |
overwrite(ParaObject obj)
Creates the object again (use with caution!).
|
abstract String |
overwrite(String appid,
ParaObject obj)
Creates the object again (use with caution!).
|
abstract List<String> |
removeTags(List<String> objectTags,
String... tag)
Removes a tag from the set of tags.
|
abstract void |
setCache(Cache cache)
Sets the Cache object.
|
abstract void |
setDao(DAO dao)
Sets the DAO object.
|
abstract void |
setIotFactory(IoTServiceFactory iotFactory)
Sets the IoT factory.
|
abstract void |
setSearch(Search search)
Sets the Search object.
|
abstract void |
unlink(ParaObject obj,
String type2,
String id2)
Unlinks an object from this one.
|
abstract void |
unlinkAll(ParaObject obj)
Unlinks all objects that are linked to this one.
|
static CoreUtils |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CoreUtils[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
abstract boolean |
vote(ParaObject votable,
String userid,
Votable.VoteValue upDown)
Casts a vote on a given object.
|
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOfonInitializepublic static final CoreUtils INSTANCE
public static CoreUtils[] values()
for (CoreUtils c : CoreUtils.values()) System.out.println(c);
public static CoreUtils valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static CoreUtils getInstance()
public abstract void setSearch(Search search)
search - Searchpublic abstract void setCache(Cache cache)
cache - Cachepublic abstract IoTServiceFactory getIotFactory()
public abstract void setIotFactory(IoTServiceFactory iotFactory)
iotFactory - factory instancepublic abstract List<String> addTags(List<String> objectTags, String... tag)
tag - a tag, must not be null or emptyobjectTags - the object tagspublic abstract List<String> removeTags(List<String> objectTags, String... tag)
tag - a tag, must not be null or emptyobjectTags - the objectpublic abstract Long countChildren(ParaObject obj, String type2)
type2 - the type of the other objectobj - the object to execute this method onpublic abstract Long countLinks(ParaObject obj, String type2)
type2 - the other type of objectobj - the object to execute this method onpublic abstract void deleteChildren(ParaObject obj, String type2)
obj - the object to execute this method ontype2 - the children's type.public abstract <P extends ParaObject> List<P> findChildren(ParaObject obj, String type2, String query, Pager... pager)
P - the type of childrentype2 - the type of children to look forobj - the object to execute this method onquery - a query stringpager - a PagerParaObject in a one-to-many relationship with this objectpublic abstract <P extends ParaObject> List<P> findLinkedObjects(ParaObject obj, String type2, String field, String query, Pager... pager)
P - type of linked objectstype2 - type of linked objects to search forobj - the object to execute this method onpager - a Pagerfield - the name of the field to target (within a nested field "nstd")query - a query stringpublic abstract <P extends ParaObject> List<P> getChildren(ParaObject obj, String type2, Pager... pager)
P - the type of childrentype2 - the type of children to look forobj - the object to execute this method onpager - a PagerParaObject in a one-to-many relationship with this objectpublic abstract <P extends ParaObject> List<P> getChildren(ParaObject obj, String type2, String field, String term, Pager... pager)
P - the type of childrentype2 - the type of children to look forfield - the field name to use as filterterm - the field value to use as filterobj - the object to execute this method onpager - a PagerParaObject in a one-to-many relationship with this objectpublic abstract <P extends ParaObject> P getCreator(ParaObject obj)
P - type of linked objectsobj - find the creator of this objectobj.getCreatorid() is nullUserpublic abstract <P extends ParaObject> List<P> getLinkedObjects(ParaObject obj, String type2, Pager... pager)
P - type of linked objectstype2 - type of linked objects to search forobj - the object to execute this method onpager - a Pagerpublic abstract List<Linker> getLinks(ParaObject obj, String type2, Pager... pager)
obj - the object to execute this method ontype2 - the other typepager - a Pagerpublic abstract String getName(String name, String id)
name - a nameid - an idpublic abstract String getObjectURI(ParaObject obj)
obj - an objectpublic abstract <P extends ParaObject> P getParent(ParaObject obj)
P - type of linked objectsobj - find the parent of this objectobj.getParentid() is nullpublic abstract boolean isLinked(ParaObject obj, String type2, String id2)
type2 - the other typeid2 - the other idobj - the object to execute this method onpublic abstract boolean isLinked(ParaObject obj, ParaObject toObj)
toObj - the other objectobj - the object to execute this method onpublic abstract String link(ParaObject obj, String id2)
id2 - link to the object with this idobj - the object to execute this method onLinker object that is createdpublic abstract String overwrite(ParaObject obj)
DAO.create(com.erudika.para.core.ParaObject).obj - an objectpublic abstract String overwrite(String appid, ParaObject obj)
DAO.create(java.lang.String, com.erudika.para.core.ParaObject).appid - the app idobj - an objectpublic abstract void unlink(ParaObject obj, String type2, String id2)
type2 - the other typeobj - the object to execute this method onid2 - the other idpublic abstract void unlinkAll(ParaObject obj)
Linker objects. Only
the links are deleted. Objects are left untouched.obj - the object to execute this method onpublic abstract boolean vote(ParaObject votable, String userid, Votable.VoteValue upDown)
votable - the object to vote onuserid - the voterupDown - up or downCopyright © 2018 Erudika. All rights reserved.