Modifier and Type | Field and Description |
---|---|
static String |
KNOWN_DESCRIPTOR |
static String |
LEVEL_DESCRIPTOR |
static String |
PRESENT_DESCRIPTOR |
static String |
STRICT_DESCRIPTOR |
Constructor and Description |
---|
Presence(PresenceIndicatorLevel level,
boolean present,
boolean strict,
boolean known)
returns a new Presence-Object
|
Modifier and Type | Method and Description |
---|---|
HashMap<String,Object> |
export()
exports the Presence to a HashMap
|
PresenceIndicatorLevel |
getLevel()
returns the (vague) level of the reliability of the data.
|
static Optional<Presence> |
importPresence(ResourceModel resourceModel)
imports (if no errors occurred) the Presence from the ResourceModel
|
boolean |
isKnown()
whether it is known that the user cause the Event
|
boolean |
isPresent()
whether it is present AND known
|
boolean |
isStrict()
whether it is strict (very high probability that the user is around)
|
public static final String LEVEL_DESCRIPTOR
public static final String PRESENT_DESCRIPTOR
public static final String STRICT_DESCRIPTOR
public static final String KNOWN_DESCRIPTOR
public Presence(PresenceIndicatorLevel level, boolean present, boolean strict, boolean known)
level
- the level of the Presence (mostly used internally)present
- whether it is presentstrict
- whether it is strictknown
- whether it is known that the user caused thispublic PresenceIndicatorLevel getLevel()
public boolean isPresent()
public boolean isStrict()
public boolean isKnown()
public HashMap<String,Object> export()
public static Optional<Presence> importPresence(ResourceModel resourceModel)
resourceModel
- the resourcemodel to import fromCopyright © 2016. All rights reserved.