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 standardizedDataFormwith form typehttp://jabber.org/protocol/pubsub#meta-data, which can be used to retrieve node meta data.Usage
To wrap an existingDataFormto 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 classNodeMetaData.BuilderA 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.Builderbuilder()Creates the builder to build a meta data form.List<Jid>getContacts()Gets the contacts.InstantgetCreationDate()Gets the creation date.JidgetCreator()Gets the creator.DataFormgetDataForm()Gets the underlying data form.StringgetDescription()Gets the description.StringgetFormType()Gets the form type of the data form.LocalegetLanguage()Gets the language.StringgetNodeTitle()Gets the title.IntegergetNumberOfSubscribers()Gets the number of subscribers.List<Jid>getOwners()Gets the owners.StringgetPayloadType()Gets the payload type of the node.List<Jid>getPublishers()Gets the publishers.NodeMetaData.BuildertoBuilder()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:StandardizedDataFormGets the form type of the data form.- Specified by:
getFormTypein interfaceStandardizedDataForm- Returns:
- The form type.
-
getDataForm
public final DataForm getDataForm()
Gets the underlying data form.- Specified by:
getDataFormin 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.
-
-