Package yapion
Class YAPIONUtils
- java.lang.Object
-
- yapion.YAPIONUtils
-
public class YAPIONUtils extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classYAPIONUtils.CheckResult
-
Field Summary
Fields 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 Summary
Modifier 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 java.util.stream.Stream<YAPIONAnyType>walk(YAPIONObject yapionObject, YAPIONTreeIterator.YAPIONTreeIteratorOption option)The inputtedYAPIONObjectis traversed depth first, values beforehand.
-
-
-
Field Detail
-
FILE_ENDING
public 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_POINT
public 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
-
isBase64YAPIONObject
public 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
-
isStringYAPIONObject
public 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
-
stringContainsYAPIONObject
public 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
-
stringGetAllYAPIONObjects
public 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
-
walk
public 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- theYAPIONObjectto traverseoption- theYAPIONTreeIterator.YAPIONTreeIteratorOptionto use- Returns:
- the
Streamwhich contains allYAPIONAnyTypeof theYAPIONObject
-
walk
public 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- theYAPIONObjectto traverse- Returns:
- the
Streamwhich contains allYAPIONAnyTypeof theYAPIONObject
-
flatten
public 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- theYAPIONObjectto flatten- Returns:
- the flattened
YAPIONObjectthis is a new instance
-
unflatten
public static YAPIONObject unflatten(YAPIONObject yapionObject)
-
-