
br.com.objectos.args.EnumOptionPropertyCodeBuilder Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2016 Objectos, Fábrica de Software LTDA.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package br.com.objectos.args;
import com.squareup.javapoet.CodeBlock;
import com.squareup.javapoet.CodeBlock.Builder;
/**
* @author [email protected] (Marcio Endo)
*/
class EnumOptionPropertyCodeBuilder {
private final CodeBlock.Builder builder;
private boolean first = true;
private EnumOptionPropertyCodeBuilder(Builder builder) {
this.builder = builder;
}
public static EnumOptionPropertyCodeBuilder of(Builder builder) {
return new EnumOptionPropertyCodeBuilder(builder);
}
public CodeBlock.Builder build() {
return builder.add(" .get()");
}
public void add(String format, Object... args) {
builder.add(format, args);
}
public void addLine(String format, Object... args) {
if (first) {
builder.add("args" + format + "\n", args);
first = false;
} else {
builder.add(" " + format + "\n", args);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy