
com.contentful.java.cda.rich.CDARichText Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-sdk Show documentation
Show all versions of java-sdk Show documentation
Java SDK for Contentful's Content Delivery API.
package com.contentful.java.cda.rich;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* A leaf element of the rich text node graph: Render a given text with the given markings.
*/
public class CDARichText extends CDARichNode implements Serializable {
private final List marks = new ArrayList<>();
private final CharSequence text;
/**
* Create a text with the given marks
*
* @param text the text to be displayed
* @param marks the marks to be used if any
*/
public CDARichText(CharSequence text, List marks) {
if (text == null) {
text = "";
}
this.marks.addAll(marks);
this.text = text;
}
/**
* @return the text of this node.
*/
public CharSequence getText() {
return text;
}
/**
* @return the marks of this text.
*
* @see CDARichMark.CDARichMarkBold
*/
public List getMarks() {
return marks;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy