类 DefaultApplicationArguments
- java.lang.Object
- org.springframework.boot.DefaultApplicationArguments
- 所有已实现的接口:
ApplicationArguments
public class DefaultApplicationArguments extends Object implements ApplicationArguments
Default implementation ofApplicationArguments
.- 从以下版本开始:
- 1.4.1
构造器概要
构造器 构造器 说明 DefaultApplicationArguments(String[] args)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
containsOption(String name)
Return whether the set of option arguments parsed from the arguments contains an option with the given name.List<String>
getNonOptionArgs()
Return the collection of non-option arguments parsed.Set<String>
getOptionNames()
Return the names of all option arguments.List<String>
getOptionValues(String name)
Return the collection of values associated with the arguments option having the given name.String[]
getSourceArgs()
Return the raw unprocessed arguments that were passed to the application.
构造器详细资料
DefaultApplicationArguments
public DefaultApplicationArguments(String[] args)
方法详细资料
getSourceArgs
public String[] getSourceArgs()
从接口复制的说明:ApplicationArguments
Return the raw unprocessed arguments that were passed to the application.- 指定者:
getSourceArgs
在接口中ApplicationArguments
- 返回:
- the arguments
getOptionNames
public Set<String> getOptionNames()
从接口复制的说明:ApplicationArguments
Return the names of all option arguments. For example, if the arguments were "--foo=bar --debug" would return the values["foo", "debug"]
.- 指定者:
getOptionNames
在接口中ApplicationArguments
- 返回:
- the option names or an empty set
containsOption
public boolean containsOption(String name)
从接口复制的说明:ApplicationArguments
Return whether the set of option arguments parsed from the arguments contains an option with the given name.- 指定者:
containsOption
在接口中ApplicationArguments
- 参数:
name
- the name to check- 返回:
true
if the arguments contain an option with the given name
getOptionValues
public List<String> getOptionValues(String name)
从接口复制的说明:ApplicationArguments
Return the collection of values associated with the arguments option having the given name.- if the option is present and has no argument (e.g.: "--foo"), return an empty collection (
[]
) - if the option is present and has a single value (e.g. "--foo=bar"), return a collection having one element (
["bar"]
) - if the option is present and has multiple values (e.g. "--foo=bar --foo=baz"), return a collection having elements for each value (
["bar", "baz"]
) - if the option is not present, return
null
- 指定者:
getOptionValues
在接口中ApplicationArguments
- 参数:
name
- the name of the option- 返回:
- a list of option values for the given name
- if the option is present and has no argument (e.g.: "--foo"), return an empty collection (
getNonOptionArgs
public List<String> getNonOptionArgs()
从接口复制的说明:ApplicationArguments
Return the collection of non-option arguments parsed.- 指定者:
getNonOptionArgs
在接口中ApplicationArguments
- 返回:
- the non-option arguments or an empty list