Class NodeMetaData
- java.lang.Object
-
- rocks.xmpp.extensions.pubsub.model.NodeMetaData
-
- All Implemented Interfaces:
StandardizedDataForm
public final class NodeMetaData extends Object implements StandardizedDataForm
Represents a standardizedDataForm
with form typehttp://jabber.org/protocol/pubsub#meta-data
, which can be used to retrieve node meta data.Usage
To wrap an existingDataForm
to retrieve standard data from it, use:
To build a form:NodeMetaData nodeMetaData = new NodeMetaData(dataForm);
NodeMetaData nodeMetaData = NodeMetaData.builder() .contacts(Collections.singleton(Jid.of("contact"))) .creationDate(date) .creator(Jid.of("creator")) .description("desc") .language("de") .numberOfSubscribers(2) .owners(Collections.singleton(Jid.of("owner"))) .publishers(Collections.singleton(Jid.of("publisher"))) .title("title") .payloadType("namespace") .build();
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NodeMetaData.Builder
A builder class to build the meta data form.
-
Constructor Summary
Constructors Constructor Description NodeMetaData(DataForm dataForm)
Creates a node meta data form.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NodeMetaData.Builder
builder()
Creates the builder to build a meta data form.List<Jid>
getContacts()
Gets the contacts.Instant
getCreationDate()
Gets the creation date.Jid
getCreator()
Gets the creator.DataForm
getDataForm()
Gets the underlying data form.String
getDescription()
Gets the description.String
getFormType()
Gets the form type of the data form.Locale
getLanguage()
Gets the language.String
getNodeTitle()
Gets the title.Integer
getNumberOfSubscribers()
Gets the number of subscribers.List<Jid>
getOwners()
Gets the owners.String
getPayloadType()
Gets the payload type of the node.List<Jid>
getPublishers()
Gets the publishers.NodeMetaData.Builder
toBuilder()
Converts this (immutable) data form to a builder, so that a modified form can be created.
-
-
-
Field Detail
-
FORM_TYPE
public static final String FORM_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NodeMetaData
public NodeMetaData(DataForm dataForm)
Creates a node meta data form.- Parameters:
dataForm
- The underlying data form.
-
-
Method Detail
-
builder
public static NodeMetaData.Builder builder()
Creates the builder to build a meta data form.- Returns:
- The builder.
-
getFormType
public final String getFormType()
Description copied from interface:StandardizedDataForm
Gets the form type of the data form.- Specified by:
getFormType
in interfaceStandardizedDataForm
- Returns:
- The form type.
-
getDataForm
public final DataForm getDataForm()
Gets the underlying data form.- Specified by:
getDataForm
in interfaceStandardizedDataForm
- Returns:
- The underlying data form.
-
getCreationDate
public final Instant getCreationDate()
Gets the creation date.- Returns:
- The creation date.
-
getCreator
public final Jid getCreator()
Gets the creator.- Returns:
- The creator.
-
getDescription
public final String getDescription()
Gets the description.- Returns:
- The description.
-
getLanguage
public final Locale getLanguage()
Gets the language.- Returns:
- The language.
-
getNumberOfSubscribers
public final Integer getNumberOfSubscribers()
Gets the number of subscribers.- Returns:
- The subscribers.
-
getNodeTitle
public final String getNodeTitle()
Gets the title.- Returns:
- The title.
-
getPayloadType
public final String getPayloadType()
Gets the payload type of the node.- Returns:
- The payload type.
-
toBuilder
public final NodeMetaData.Builder toBuilder()
Converts this (immutable) data form to a builder, so that a modified form can be created.- Returns:
- The builder.
-
-