本文整理汇总了Java中org.tomitribe.crest.api.Default类的典型用法代码示例。如果您正苦于以下问题:Java Default类的具体用法?Java Default怎么用?Java Default使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Default类属于org.tomitribe.crest.api包,在下文中一共展示了Default类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rsync
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
@Command
// CHECKSTYLE:OFF
public void rsync(@Option("recursive") final boolean recursive,
@Option("links") final boolean links,
@Option("perms") final boolean perms,
@Option("owner") final boolean owner,
@Option("group") final boolean group,
@Option("devices") final boolean devices,
@Option("specials") final boolean specials,
@Option("times") final boolean times,
@Option("exclude") final Pattern exclude,
@Option("exclude-from") final File excludeFrom,
@Option("include") final Pattern include,
@Option("include-from") final File includeFrom,
@Option("progress") @Default("true") final boolean progress,
final URI[] sources,
final URI dest)
{
// TODO write the implementation...
}
示例2: rsync
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
@Command
public void rsync(@Option("recursive") final boolean recursive,
@Option("links") final boolean links,
@Option("perms") final boolean perms,
@Option("owner") final boolean owner,
@Option("group") final boolean group,
@Option("devices") final boolean devices,
@Option("specials") final boolean specials,
@Option("times") final boolean times,
Patterns patterns,
@Option("progress") @Default("true") final boolean progress,
final URI[] sources,
final URI dest
) {
}
示例3: test
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
@Command
public void test(@Option("recursive") final boolean recursive,
@Option("links") final boolean links,
@Option("perms") final boolean perms,
@Option("owner") @Default("${user.name}") final String owner,
@Option("group") final boolean group,
@Option("devices") final boolean devices,
@Option("specials") final boolean specials,
@Option("times") final boolean times,
Patterns patterns,
@Option("highlight") @Default("orange") final Color highlight,
@Option("foreground") @Default("orange") final Color foreground,
@Option("background") final Color background,
final URI source,
final URI dest
) {
}
示例4: doAll
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
@Command
public void doAll(
@Option("byte") @Default("42") final byte byteValue,
@Option("char") @Default("D") final char charValue,
@Option("boolean") @Default("true") final boolean booleanValue,
@Option("short") @Default("1024") final short shortValue,
@Option("int") @Default("3301976") final int intValue,
@Option("long") @Default("10000000000") final long longValue,
@Option("float") @Default("10.0") final float floatValue,
@Option("double") @Default("20.0") final double doubleValue
) {
assertEquals(defaultByte, byteValue);
assertEquals(defaultChar, charValue);
assertEquals(defaultBoolean, booleanValue);
assertEquals(defaultShort, shortValue);
assertEquals(defaultInt, intValue);
assertEquals(defaultLong, longValue);
assertEquals(defaultFloat, floatValue);
assertEquals(defaultDouble, doubleValue);
}
示例5: rsync
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
@Command
public void rsync(@Option("recursive") final boolean recursive,
@Option("links") final boolean links,
@Option("perms") final boolean perms,
@Option("owner") final boolean owner,
@Option("group") final boolean group,
@Option("devices") final boolean devices,
@Option("specials") final boolean specials,
@Option("times") final boolean times,
@Option("exclude") final Pattern exclude,
@Option("exclude-from") final File excludeFrom,
@Option("include") final Pattern include,
@Option("include-from") final File includeFrom,
@Option({"progress", "p"}) @Default("true") final boolean progress,
final URI[] sources,
final URI dest
) {
}
示例6: test
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
@Command
public void test(@Option({"r", "recursive"}) final boolean recursive,
@Option({"links", "l"}) final boolean links,
@Option({"p", "perms"}) final boolean perms,
@Option("owner") @Default("${user.name}") final String owner,
@Option("group") final boolean group,
@Option("devices") final boolean devices,
@Option("specials") final boolean specials,
@Option("times") final boolean times,
@Option("x") final boolean x,
@Option({"exclude", "e"}) final Pattern exclude,
@Option("exclude-from") final File excludeFrom,
@Option("include") @Default(".*") final Pattern include,
@Option("include-from") final File includeFrom,
@Option("highlight") @Default("orange") final Color highlight,
@Option("foreground") @Default("orange") final Color foreground,
@Option({"background", "bg"}) final Color background,
final URI source,
final URI dest
) {
}
示例7: doAllExplicit
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
@Command
public void doAllExplicit(
@Option("user-home") @Default("${user.home}") final Value defaultParameter,
@Option("directory") @Default("${user.home}\u0000${user.dir}") final Value[] defaultParameters,
@Option("format") final Value explicitParameter,
@Option("pattern") final Value[] explicitParameters,
final Value explicitArgument,
final Value[] explicitArguments
) {
// Explicit values are NOT interpreted
final Value userHome = new Value("${user.home}");
final Value userDir = new Value("${user.dir}");
assertEquals(userHome, defaultParameter);
assertEquals(userHome, defaultParameters[0]);
assertEquals(userDir, defaultParameters[1]);
assertEquals(userHome, explicitParameter);
assertEquals(userHome, explicitParameters[0]);
assertEquals(userDir, explicitParameters[1]);
assertEquals(userHome, explicitArgument);
assertEquals(userHome, explicitArguments[0]);
assertEquals(userDir, explicitArguments[1]);
}
示例8: findDupes
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
@Command
public void findDupes(@Option("pattern") List<String> patterns,
@Option("path") List<String> paths,
@Option("verbose") @Default("false") boolean verbose,
@Option("show-timings") @Default("false") boolean showTimings) {
if (verbose) {
System.out.println("Scanning for duplicate files.");
System.out.println("Search paths:");
paths.forEach(p -> System.out.println("\t" + p));
System.out.println("Search patterns:");
patterns.forEach(p -> System.out.println("\t" + p));
System.out.println();
}
final Instant startTime = Instant.now();
FileFinder ff = new FileFinder();
patterns.forEach(p -> ff.addPattern(p));
paths.forEach(p -> ff.addPath(p));
ff.find();
System.out.println("The following duplicates have been found:");
java.math.BigInteger b;
final AtomicInteger group = new AtomicInteger(1);
ff.getDuplicates().forEach((name, list) -> {
System.out.printf("Group #%d:%n", group.getAndIncrement());
list.forEach(fileInfo -> System.out.println("\t" + fileInfo.getPath()));
});
final Instant endTime = Instant.now();
if (showTimings) {
Duration duration = Duration.between(startTime, endTime);
long hours = duration.toHours();
long minutes = duration.minusHours(hours).toMinutes();
long seconds = duration.minusHours(hours).minusMinutes(minutes).toMillis() / 1000;
System.out.println(String.format("%nThe scan took %d hours, %d minutes, and %d seconds.%n", hours, minutes, seconds));
}
}
示例9: validate
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
private void validate() {
for (final Param param : spec.arguments) {
if (param.isAnnotationPresent(Default.class)) {
throw new IllegalArgumentException("@Default only usable with @Option parameters.");
}
if (!param.isListable() && param.isAnnotationPresent(Required.class)) {
throw new IllegalArgumentException("@Required only usable with @Option parameters and lists.");
}
}
}
示例10: doByte
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
@Command
public void doByte(@Option("foo") @Default("2,3,5") final List<Byte> list, @Option("color") final Color colorParam, final Color colorArg) {
assertNotNull(list);
final Iterator<Byte> it = list.iterator();
assertEquals((Byte) (byte) 2, it.next());
assertEquals((Byte) (byte) 3, it.next());
assertEquals((Byte) (byte) 5, it.next());
assertFalse(it.hasNext());
assertEquals(Color.orange, colorParam);
assertEquals(Color.green, colorArg);
}
示例11: doBoolean
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
@Command
public void doBoolean(@Option("foo") @Default("false,true,false") final List<Boolean> list, @Option("color") final Color colorParam, final Color colorArg) {
assertNotNull(list);
final Iterator<Boolean> it = list.iterator();
assertEquals(Boolean.FALSE, it.next());
assertEquals(Boolean.TRUE, it.next());
assertEquals(Boolean.FALSE, it.next());
assertFalse(it.hasNext());
assertEquals(Color.orange, colorParam);
assertEquals(Color.green, colorArg);
}
示例12: doCharacter
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
@Command
public void doCharacter(@Option("foo") @Default("2,3,5") final List<Character> list, @Option("color") final Color colorParam, final Color colorArg) {
assertNotNull(list);
final Iterator<Character> it = list.iterator();
assertEquals((Character) '2', it.next());
assertEquals((Character) '3', it.next());
assertEquals((Character) '5', it.next());
assertFalse(it.hasNext());
assertEquals(Color.orange, colorParam);
assertEquals(Color.green, colorArg);
}
示例13: doShort
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
@Command
public void doShort(@Option("foo") @Default("2,3,5") final List<Short> list, @Option("color") final Color colorParam, final Color colorArg) {
assertNotNull(list);
final Iterator<Short> it = list.iterator();
assertEquals((Short) (short) 2, it.next());
assertEquals((Short) (short) 3, it.next());
assertEquals((Short) (short) 5, it.next());
assertFalse(it.hasNext());
assertEquals(Color.orange, colorParam);
assertEquals(Color.green, colorArg);
}
示例14: doInt
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
@Command
public void doInt(@Option("foo") @Default("2,3,5") final List<Integer> list, @Option("color") final Color colorParam, final Color colorArg) {
assertNotNull(list);
final Iterator<Integer> it = list.iterator();
assertEquals((Integer) 2, it.next());
assertEquals((Integer) 3, it.next());
assertEquals((Integer) 5, it.next());
assertFalse(it.hasNext());
assertEquals(Color.orange, colorParam);
assertEquals(Color.green, colorArg);
}
示例15: doLong
import org.tomitribe.crest.api.Default; //导入依赖的package包/类
@Command
public void doLong(@Option("foo") @Default("2,3,5") final List<Long> list, @Option("color") final Color colorParam, final Color colorArg) {
assertNotNull(list);
final Iterator<Long> it = list.iterator();
assertEquals((Long) (long) 2, it.next());
assertEquals((Long) (long) 3, it.next());
assertEquals((Long) (long) 5, it.next());
assertFalse(it.hasNext());
assertEquals(Color.orange, colorParam);
assertEquals(Color.green, colorArg);
}