1 /** 2 * Copyright (C) 2010 the original author or authors. 3 * See the notice.md file distributed with this work for additional 4 * information regarding copyright ownership. 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 package com.beust.jcommander.args; 20 21 import com.beust.jcommander.Parameter; 22 import com.beust.jcommander.internal.Lists; 23 24 import java.math.BigDecimal; 25 import java.util.Date; 26 import java.util.List; 27 28 public class Args1Setter { 29 @Parameter setParameters(List<String> p)30 public void setParameters(List<String> p) { 31 parameters = p; 32 } 33 getParameters()34 public List<String> getParameters() { 35 return this.parameters; 36 } 37 public List<String> parameters = Lists.newArrayList(); 38 39 @Parameter(names = { "-log", "-verbose" }, description = "Level of verbosity", required = true) setVerbose(Integer v)40 public void setVerbose(Integer v) { 41 verbose = v; 42 } 43 public Integer verbose = 1; 44 45 @Parameter(names = "-groups", description = "Comma-separated list of group names to be run") setGroups(String g)46 public void setGroups(String g) { 47 groups = g; 48 } 49 50 public String groups; 51 52 @Parameter(names = "-debug", description = "Debug mode") setDebug(boolean d)53 public void setDebug(boolean d) { 54 debug = d; 55 } 56 57 public boolean debug = false; 58 59 @Parameter(names = "-long", description = "A long number") setLong(long ll)60 public void setLong(long ll) { 61 l = ll; 62 } 63 64 public long l; 65 66 @Parameter(names = "-double", description = "A double number") setDouble(double d)67 public void setDouble(double d) { 68 doub = d; 69 } 70 71 public double doub; 72 73 @Parameter(names = "-float", description = "A float number") setFloat(float f)74 public void setFloat(float f) { 75 floa = f; 76 } 77 78 public float floa; 79 80 @Parameter(names = "-bigdecimal", description = "A BigDecimal number") setBigDecimal(BigDecimal bd)81 public void setBigDecimal(BigDecimal bd) { 82 bigd = bd; 83 } 84 85 public BigDecimal bigd; 86 87 @Parameter(names = "-date", description = "An ISO 8601 formatted date.") setDate(Date d)88 public void setDate(Date d) { 89 date = d; 90 } 91 92 public Date date; 93 } 94