PetBehaviorYaml

public final class PetBehaviorYaml

Values from a pet file written back the way the file would write them, for warnings server owners read.

Functions

Link copied to clipboard
public static String describe(Object entry)
A bad list entry as its author would recognize it: quoted as YAML read it, since YAML turns on into true, or "an empty entry" when it holds nothing.
Link copied to clipboard
public static boolean isEmpty(Object entry)
Whether a list entry holds nothing to show: no value, blank text, or an empty map or list.
Link copied to clipboard
public static String plain(Object value)
As a pet file writes it: text as is (empty text as ""), whole numbers without a trailing .0, .nan and .inf, maps as { key: value } and a missing value as nothing.
Link copied to clipboard
public static String plainPairs(Map<? extends Object, ? extends Object> map)
A map's pairs without the braces, as one line of a pet file writes them: radius: 8, height:.
Link copied to clipboard
public static String typed(Object value)
Like plain, with text in quotes, so 8, true and "8" look different.