Package ws.schild.jave.encode
Class ValueArgument
- java.lang.Object
-
- ws.schild.jave.encode.ValueArgument
-
- All Implemented Interfaces:
EncodingArgument
public class ValueArgument extends java.lang.Object implements EncodingArgument
A ValueArgument is an EncodingArgument that is optionally present based on the presence of the provided valueGetter.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringargumentNameprivate ArgTypeargumentTypeprivate java.util.function.Function<EncodingAttributes,java.util.Optional<java.lang.String>>valueGetter
-
Constructor Summary
Constructors Constructor Description ValueArgument(ArgType argType, java.lang.String argumentName, java.util.function.Function<EncodingAttributes,java.util.Optional<java.lang.String>> valueGetter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArgTypegetArgType()java.util.stream.Stream<java.lang.String>getArguments(EncodingAttributes context)Gets the Stream of arguments given the EncodingAttributes as context.private java.lang.StringgetName()private java.util.Optional<java.lang.String>getValue(EncodingAttributes context)protected java.lang.BooleanisPresent(EncodingAttributes context)
-
-
-
Field Detail
-
argumentType
private final ArgType argumentType
-
argumentName
private final java.lang.String argumentName
-
valueGetter
private final java.util.function.Function<EncodingAttributes,java.util.Optional<java.lang.String>> valueGetter
-
-
Constructor Detail
-
ValueArgument
public ValueArgument(ArgType argType, java.lang.String argumentName, java.util.function.Function<EncodingAttributes,java.util.Optional<java.lang.String>> valueGetter)
-
-
Method Detail
-
isPresent
protected java.lang.Boolean isPresent(EncodingAttributes context)
-
getArguments
public java.util.stream.Stream<java.lang.String> getArguments(EncodingAttributes context)
Description copied from interface:EncodingArgumentGets the Stream of arguments given the EncodingAttributes as context. Implementers must take care to return a new Stream on each successive call as doing otherwise will result in the stream already being operated on exceptions.- Specified by:
getArgumentsin interfaceEncodingArgument- Parameters:
context- The EncodingAttributes specified by the user. Use this in your closure to generate the arguments you'd like to pass to ffmpeg.- Returns:
- A stream of arguments to pass to ffmpeg.
-
getName
private java.lang.String getName()
-
getValue
private java.util.Optional<java.lang.String> getValue(EncodingAttributes context)
-
getArgType
public ArgType getArgType()
- Specified by:
getArgTypein interfaceEncodingArgument
-
-