Package com.linecorp.centraldogma.common
Class MergedEntry<T>
java.lang.Object
com.linecorp.centraldogma.common.MergedEntry<T>
- Type Parameters:
T
- the content type. It isJsonNode
because only JSON merge is currently supported.
- All Implemented Interfaces:
ContentHolder<T>
public final class MergedEntry<T> extends Object implements ContentHolder<T>
A merged entry in a repository.
-
Method Summary
Modifier and Type Method Description T
content()
Returns the content.String
contentAsPrettyText()
Returns the prettified textual representation of the specified content.String
contentAsText()
Returns the textual representation of the specified content.boolean
equals(Object o)
int
hashCode()
static <T> MergedEntry<T>
of(Revision revision, EntryType type, T content, Iterable<String> paths)
Returns a newly-createdMergedEntry
.static <T> MergedEntry<T>
of(Revision revision, EntryType type, T content, String... paths)
Returns a newly-createdMergedEntry
.List<String>
paths()
Returns the paths which participated to compose theMergedEntry
.Revision
revision()
Returns theRevision
of thisMergedEntry
.String
toString()
EntryType
type()
Returns theEntryType
of the content.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.linecorp.centraldogma.common.ContentHolder
contentAsJson, contentAsJson
-
Method Details
-
of
Returns a newly-createdMergedEntry
.- Type Parameters:
T
- the content type. It isJsonNode
because only JSON merge is currently supported.- Parameters:
revision
- the revision of theMergedEntry
type
- the type of theMergedEntry
content
- the content of theMergedEntry
paths
- the paths which participated to compose theMergedEntry
-
of
public static <T> MergedEntry<T> of(Revision revision, EntryType type, T content, Iterable<String> paths)Returns a newly-createdMergedEntry
.- Type Parameters:
T
- the content type. It isJsonNode
because only JSON merge is currently supported.- Parameters:
revision
- the revision of theMergedEntry
type
- the type of theMergedEntry
content
- the content of theMergedEntry
paths
- the paths which participated to compose theMergedEntry
-
revision
Returns theRevision
of thisMergedEntry
. -
type
Description copied from interface:ContentHolder
Returns theEntryType
of the content.- Specified by:
type
in interfaceContentHolder<T>
-
content
Description copied from interface:ContentHolder
Returns the content.- Specified by:
content
in interfaceContentHolder<T>
-
paths
Returns the paths which participated to compose theMergedEntry
. -
contentAsText
Description copied from interface:ContentHolder
Returns the textual representation of the specified content.- Specified by:
contentAsText
in interfaceContentHolder<T>
-
contentAsPrettyText
Description copied from interface:ContentHolder
Returns the prettified textual representation of the specified content. Only aTreeNode
is prettified currently.- Specified by:
contentAsPrettyText
in interfaceContentHolder<T>
-
hashCode
public int hashCode() -
equals
-
toString
-