Package org.rundeck.client.tool.format
Class YamlFormatter
- java.lang.Object
-
- org.rundeck.client.tool.format.BaseDataOutputFormatter
-
- org.rundeck.client.tool.format.YamlFormatter
-
- All Implemented Interfaces:
OutputFormatter
public class YamlFormatter extends BaseDataOutputFormatter
Format objects as YAML, this will convert any Map/Collection into Yaml, and any Object that implementsFormatableand returns a non-null Map or List. If the object does not correspond to one of those inputs, the base formatter will be used
-
-
Constructor Summary
Constructors Constructor Description YamlFormatter()YamlFormatter(java.util.function.Function<java.lang.Object,java.util.Optional<Formatable>> dataFormatter, org.yaml.snakeyaml.Yaml yaml)YamlFormatter(OutputFormatter base)YamlFormatter(OutputFormatter base, java.util.function.Function<java.lang.Object,java.util.Optional<Formatable>> dataFormatter, org.yaml.snakeyaml.Yaml yaml)YamlFormatter(OutputFormatter base, org.yaml.snakeyaml.DumperOptions options)YamlFormatter(org.yaml.snakeyaml.representer.Representer representer, org.yaml.snakeyaml.DumperOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanFormatObject(java.lang.Object value)protected java.lang.StringformatObject(java.lang.Object o)protected OutputFormatterwithBase(java.util.function.Function<java.lang.Object,java.util.Optional<Formatable>> dataFormatter, OutputFormatter base)-
Methods inherited from class org.rundeck.client.tool.format.BaseDataOutputFormatter
format, formatList, formatMap, withBase
-
-
-
-
Constructor Detail
-
YamlFormatter
public YamlFormatter()
-
YamlFormatter
public YamlFormatter(org.yaml.snakeyaml.representer.Representer representer, org.yaml.snakeyaml.DumperOptions options)
-
YamlFormatter
public YamlFormatter(java.util.function.Function<java.lang.Object,java.util.Optional<Formatable>> dataFormatter, org.yaml.snakeyaml.Yaml yaml)
-
YamlFormatter
public YamlFormatter(OutputFormatter base)
- Parameters:
base- base formatter
-
YamlFormatter
public YamlFormatter(OutputFormatter base, java.util.function.Function<java.lang.Object,java.util.Optional<Formatable>> dataFormatter, org.yaml.snakeyaml.Yaml yaml)
-
YamlFormatter
public YamlFormatter(OutputFormatter base, org.yaml.snakeyaml.DumperOptions options)
- Parameters:
base- base formatteroptions- yaml options
-
-
Method Detail
-
withBase
protected OutputFormatter withBase(java.util.function.Function<java.lang.Object,java.util.Optional<Formatable>> dataFormatter, OutputFormatter base)
- Specified by:
withBasein classBaseDataOutputFormatter
-
canFormatObject
protected boolean canFormatObject(java.lang.Object value)
- Specified by:
canFormatObjectin classBaseDataOutputFormatter
-
formatObject
protected java.lang.String formatObject(java.lang.Object o)
- Specified by:
formatObjectin classBaseDataOutputFormatter
-
-