org.mnode.ical4j.json.schema.SchemaServiceBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ical4j-json Show documentation
Show all versions of ical4j-json Show documentation
Custom marshalling between iCal4j objects and JSON formats
The newest version!
package org.mnode.ical4j.json.schema;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import net.fortuna.ical4j.model.Property;
import net.fortuna.ical4j.model.component.VAvailability;
public class SchemaServiceBuilder extends AbstractSchemaBuilder {
public SchemaServiceBuilder() {
super("Service");
}
@Override
public JsonNode build() {
ObjectNode node = createObjectNode();
putIfNotNull("@id", node, component.getProperty(Property.UID));
putIfNotNull("name", node, component.getProperty(Property.SUMMARY));
putIfNotNull("description", node, component.getProperty(Property.DESCRIPTION));
putIfNotNull("url", node, component.getProperty(Property.URL));
return node;
}
}