Package com.linecorp.centraldogma.common
Class Entry<T>
java.lang.Object
com.linecorp.centraldogma.common.Entry<T>
- All Implemented Interfaces:
ContentHolder<T>
A file or a directory in a repository.
-
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the content.Returns the prettified textual representation of the specified content.Returns the textual representation of the specified content.booleanbooleanReturns if thisEntryhas content, which is alwaystrueif it's not a directory.inthashCode()voidifHasContent(Consumer<? super T> consumer) static <T> Entry<T> Returns a newly-createdEntry.ofDirectory(Revision revision, String path) Returns a newly-createdEntryof a directory.Returns a newly-createdEntryof a JSON file.Returns a newly-createdEntryof a JSON file.Returns a newly-createdEntryof a text file.path()Returns the path of thisEntry.revision()Returns the revision of thisEntry.toString()type()Returns theEntryTypeof the content.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.linecorp.centraldogma.common.ContentHolder
contentAsJson, contentAsJson
-
Method Details
-
ofDirectory
Returns a newly-createdEntryof a directory.- Parameters:
revision- the revision of the directorypath- the path of the directory
-
ofJson
Returns a newly-createdEntryof a JSON file.- Parameters:
revision- the revision of the JSON filepath- the path of the JSON filecontent- the content of the JSON file
-
ofJson
public static Entry<JsonNode> ofJson(Revision revision, String path, String content) throws JsonParseException Returns a newly-createdEntryof a JSON file.- Parameters:
revision- the revision of the JSON filepath- the path of the JSON filecontent- the content of the JSON file- Throws:
JsonParseException- if thecontentis not a valid JSON
-
ofText
Returns a newly-createdEntryof a text file.- Parameters:
revision- the revision of the text filepath- the path of the text filecontent- the content of the text file
-
of
Returns a newly-createdEntry. -
revision
Returns the revision of thisEntry. -
path
Returns the path of thisEntry. -
hasContent
public boolean hasContent()Returns if thisEntryhas content, which is alwaystrueif it's not a directory. -
ifHasContent
-
type
Description copied from interface:ContentHolderReturns theEntryTypeof the content.- Specified by:
typein interfaceContentHolder<T>
-
content
Description copied from interface:ContentHolderReturns the content.- Specified by:
contentin interfaceContentHolder<T>
-
contentAsText
Description copied from interface:ContentHolderReturns the textual representation of the specified content.- Specified by:
contentAsTextin interfaceContentHolder<T>
-
contentAsPrettyText
Description copied from interface:ContentHolderReturns the prettified textual representation of the specified content. Only aTreeNodeis prettified currently.- Specified by:
contentAsPrettyTextin interfaceContentHolder<T>
-
hashCode
public int hashCode() -
equals
-
toString
-