Package yapion
Class YAPIONUtils
- java.lang.Object
- 
- yapion.YAPIONUtils
 
- 
 public class YAPIONUtils extends java.lang.Object
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classYAPIONUtils.CheckResult
 - 
Field SummaryFields Modifier and Type Field Description static java.lang.StringFILE_ENDINGThis is the default file ending associated by a file with the format yapion, For more information seeYAPIONParserorYAPIONInputStream.static java.lang.StringFILE_ENDING_POINTThis is the default file ending associated by a file with the format yapion, For more information seeYAPIONParserorYAPIONInputStream.
 - 
Method SummaryModifier and Type Method Description static YAPIONObjectflatten(YAPIONObject yapionObject)The inputtedYAPIONObjectis flattened to oneYAPIONObjectas the main layer.static YAPIONUtils.CheckResultisBase64YAPIONObject(java.lang.String base64)Check if a base64 encoded String can be a YAPION Object serialized by theYAPIONSerializerthat can be deserialized by theYAPIONDeserializer.static YAPIONUtils.CheckResultisStringYAPIONObject(java.lang.String string)Check if a generic String can be a YAPION Object serialized by theYAPIONSerializerthat can be deserialized by theYAPIONDeserializer.static YAPIONUtils.CheckResultstringContainsYAPIONObject(java.lang.String string)Check if a generic String has YAPIONObjects embedded which can be deserialized by theYAPIONDeserializer.static java.util.List<YAPIONObject>stringGetAllYAPIONObjects(java.lang.String string)Retrieve anyYAPIONObjectembedded in an generic String.static YAPIONObjectunflatten(YAPIONObject yapionObject)static java.util.stream.Stream<YAPIONAnyType>walk(YAPIONObject yapionObject)The inputtedYAPIONObjectis traversed depth first, values beforehand.static <T extends YAPIONAnyType>
 java.util.stream.Stream<T>walk(YAPIONObject yapionObject, java.lang.Class<T> classToWalk)The inputtedYAPIONObjectis traversed depth first, values beforehand.static java.util.stream.Stream<YAPIONAnyType>walk(YAPIONObject yapionObject, YAPIONTreeIterator.YAPIONTreeIteratorOption option)The inputtedYAPIONObjectis traversed depth first, values beforehand.
 
- 
- 
- 
Field Detail- 
FILE_ENDINGpublic static final java.lang.String FILE_ENDING This is the default file ending associated by a file with the format yapion, For more information seeYAPIONParserorYAPIONInputStream.- See Also:
- Constant Field Values
 
 - 
FILE_ENDING_POINTpublic static final java.lang.String FILE_ENDING_POINT This is the default file ending associated by a file with the format yapion, For more information seeYAPIONParserorYAPIONInputStream.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
isBase64YAPIONObjectpublic static YAPIONUtils.CheckResult isBase64YAPIONObject(java.lang.String base64) Check if a base64 encoded String can be a YAPION Object serialized by theYAPIONSerializerthat can be deserialized by theYAPIONDeserializer.- Parameters:
- base64- the base64 string to check
- Returns:
- the estimate if the string is yapion or not
 
 - 
isStringYAPIONObjectpublic static YAPIONUtils.CheckResult isStringYAPIONObject(java.lang.String string) Check if a generic String can be a YAPION Object serialized by theYAPIONSerializerthat can be deserialized by theYAPIONDeserializer.- Parameters:
- string- the string to check
- Returns:
- the estimate if the string is yapion or not
 
 - 
stringContainsYAPIONObjectpublic static YAPIONUtils.CheckResult stringContainsYAPIONObject(java.lang.String string) Check if a generic String has YAPIONObjects embedded which can be deserialized by theYAPIONDeserializer.- Parameters:
- string- the string to check
- Returns:
- the result if the String contains an YAPIONObject
 
 - 
stringGetAllYAPIONObjectspublic static java.util.List<YAPIONObject> stringGetAllYAPIONObjects(java.lang.String string) Retrieve anyYAPIONObjectembedded in an generic String.- Parameters:
- string- the string to extract from
- Returns:
- all YAPIONObject's that got extracted
 
 - 
walkpublic static java.util.stream.Stream<YAPIONAnyType> walk(YAPIONObject yapionObject, YAPIONTreeIterator.YAPIONTreeIteratorOption option) The inputtedYAPIONObjectis traversed depth first, values beforehand. Outputs anStreamofYAPIONAnyTypeof all keys in the wholeYAPIONObject. This method is inspired byFiles.walk(Path, FileVisitOption...)- Parameters:
- yapionObject- the- YAPIONObjectto traverse
- option- the- YAPIONTreeIterator.YAPIONTreeIteratorOptionto use
- Returns:
- the Streamwhich contains allYAPIONAnyTypeof theYAPIONObject
 
 - 
walkpublic static <T extends YAPIONAnyType> java.util.stream.Stream<T> walk(YAPIONObject yapionObject, java.lang.Class<T> classToWalk) The inputtedYAPIONObjectis traversed depth first, values beforehand. Outputs anStreamofYAPIONAnyTypeof all keys in the wholeYAPIONObject. This method is inspired byFiles.walk(Path, FileVisitOption...)- Type Parameters:
- T- the type to walk
- Parameters:
- yapionObject- to traverse
- classToWalk- the class of given type
- Returns:
- the Streamwhich contains all 'T' of theYAPIONObject
 
 - 
walkpublic static java.util.stream.Stream<YAPIONAnyType> walk(YAPIONObject yapionObject) The inputtedYAPIONObjectis traversed depth first, values beforehand. Outputs anStreamofYAPIONAnyTypeof all keys in the wholeYAPIONObject. This method is inspired byFiles.walk(Path, FileVisitOption...)- Parameters:
- yapionObject- the- YAPIONObjectto traverse
- Returns:
- the Streamwhich contains allYAPIONAnyTypeof theYAPIONObject
 
 - 
flattenpublic static YAPIONObject flatten(YAPIONObject yapionObject) The inputtedYAPIONObjectis flattened to oneYAPIONObjectas the main layer. Every value will be put under this and every structure will be removed. This will also remove any information about maps arrays and such.
 (@pointer:...) will represent a pointer- Parameters:
- yapionObject- the- YAPIONObjectto flatten
- Returns:
- the flattened YAPIONObjectthis is a new instance
 
 - 
unflattenpublic static YAPIONObject unflatten(YAPIONObject yapionObject) 
 
- 
 
-