本文整理汇总了Java中org.immutables.builder.Builder类的典型用法代码示例。如果您正苦于以下问题:Java Builder类的具体用法?Java Builder怎么用?Java Builder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Builder类属于org.immutables.builder包,在下文中一共展示了Builder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: terminateWorkflowRequest
import org.immutables.builder.Builder; //导入依赖的package包/类
/**
* Records a WorkflowExecutionTerminated event and forces closure of the workflow execution identified
* by the given domain, runId, and workflowId. The child policy, registered with the workflow type
* or specified when starting this execution, is applied to any open child workflow executions
* of this workflow execution.
*
* <b>Note</b>
* If a runId is not specified, then the WorkflowExecutionTerminated event is recorded in the
* history of the current open workflow with the matching workflowId in the domain.
*/
@Builder.Factory
public static TerminateWorkflowExecutionRequest terminateWorkflowRequest(
@Nonnull Domain domain,
@Nonnull WorkflowId workflowId,
Optional<RunId> runId,
Optional<Reason> reason,
Optional<Details> details,
Optional<ChildPolicy> childPolicy) {
ChildPolicy cp = childPolicy.orElse(ChildPolicy.TERMINATE);
return new TerminateWorkflowExecutionRequest()
.withDomain(domain.value())
.withWorkflowId(workflowId.value())
.withRunId(runId.map(RunId::value).orElse(null))
.withReason(reason.map(Reason::value).orElse(null))
.withDetails(details.map(Details::value).orElse(null))
.withChildPolicy(cp);
}
示例2: genericSuperstring
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
@SuppressWarnings("all")
public static <T, V extends RuntimeException> String genericSuperstring(int theory, T reality, @Nullable V evidence)
throws V {
if (evidence != null) {
throw evidence;
}
return theory + " != " + reality;
}
示例3: apply
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
static SparkJni sparkJni(@Nonnull Optional<String> appName, @Nonnull String nativePath, @Nonnull Optional<String> jdkPath, @Nonnull Optional<String> classpath) {
final SparkJni sparkJniSingleton = injectSparkJni();
sparkJniSingleton.initVars(appName.isPresent() ? appName.get() : null, nativePath, jdkPath.isPresent() ? jdkPath.get() : null);
classpath.transform(new Function<String, Object>() {
@Nullable
@Override
public Object apply(@Nullable String s) {
sparkJniSingleton.addToClasspath(s);
return new Object();
}
});
return sparkJniSingleton;
}
示例4: workflowExecutionRequest
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
public static StartWorkflowExecutionRequest workflowExecutionRequest(
@Nonnull Workflow<?, ?> workflow,
@Nonnull Domain domain,
@Nonnull WorkflowId workflowId,
Optional<TaskListName> taskList,
Optional<Input> input,
Optional<List<Tag>> tags,
@Nullable Duration executionStartToCloseTimeout,
@Nullable ChildPolicy childPolicy,
@Nullable Duration taskStartToCloseTimeout) {
tags.ifPresent( t -> Preconditions.checkArgument(t.size() < MAX_NUMBER_TAGS,
"'tags' is longer than supported max length"));
executionStartToCloseTimeout = MoreObjects.firstNonNull(executionStartToCloseTimeout,
workflow.executionStartToCloseTimeout());
taskStartToCloseTimeout = MoreObjects.firstNonNull(taskStartToCloseTimeout,
workflow.taskStartToCloseTimeout());
childPolicy = MoreObjects.firstNonNull(childPolicy,
workflow.childPolicy());
return new StartWorkflowExecutionRequest()
.withWorkflowId(workflowId.value())
.withDomain(domain.value())
.withTaskList(new TaskList()
.withName(taskList.orElse(workflow.taskList()).value()))
.withWorkflowType(new WorkflowType()
.withName(workflow.name().value())
.withVersion(workflow.version().value()))
.withInput(input.map(Input::value).orElse(null))
.withTagList(tags.map( t -> t.stream().map(Tag::value).collect(toList())).orElse(null))
.withExecutionStartToCloseTimeout(String.valueOf(executionStartToCloseTimeout.getSeconds()))
.withTaskStartToCloseTimeout(String.valueOf(taskStartToCloseTimeout.getSeconds()))
.withChildPolicy(childPolicy.name());
}
示例5: registerWorkflowTypeRequest
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
public static RegisterWorkflowTypeRequest registerWorkflowTypeRequest(
@Nonnull Workflow<?, ?> workflow,
@Nonnull Domain domain) {
return new RegisterWorkflowTypeRequest()
.withDomain(domain.value())
.withDefaultTaskList(new TaskList().withName(workflow.taskList().value()))
.withName(workflow.name().value())
.withVersion(workflow.version().value())
.withDefaultExecutionStartToCloseTimeout(String.valueOf(workflow.executionStartToCloseTimeout().getSeconds()))
.withDefaultTaskStartToCloseTimeout(String.valueOf(workflow.taskStartToCloseTimeout().getSeconds()))
.withDefaultChildPolicy(workflow.childPolicy().name())
.withDescription(workflow.description().value());
}
示例6: recordActivityTaskHeartbeatRequest
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
public static RecordActivityTaskHeartbeatRequest recordActivityTaskHeartbeatRequest(
@Nonnull String taskToken,
Optional<Details> details) {
return new RecordActivityTaskHeartbeatRequest()
.withTaskToken(taskToken)
.withDetails(details.map(Details::value).orElse(null));
}
示例7: scheduleActivityTaskDecision
import org.immutables.builder.Builder; //导入依赖的package包/类
/**
* @return decision of type {@link DecisionType#ScheduleActivityTask}
*/
@Builder.Factory
public static Decision scheduleActivityTaskDecision(
@Nonnull ActionId actionId,
@Nonnull Name name,
@Nonnull Version version,
Optional<String> input,
Optional<Control> control,
Optional<TaskListName> taskListName,
Optional<String> heartbeatTimeout,
Optional<String> scheduleToCloseTimeout,
Optional<String> scheduleToStartTimeout,
Optional<String> startToCloseTimeout,
Optional<Integer> taskPriority) {
TaskList taskList = taskListName.map(TaskListName::value)
.map(t -> new TaskList().withName(t)).orElse(null);
String taskPriorityString = taskPriority.map(String::valueOf).orElse(null);
return new Decision()
.withDecisionType(DecisionType.ScheduleActivityTask)
.withScheduleActivityTaskDecisionAttributes(new ScheduleActivityTaskDecisionAttributes()
.withActivityType(new ActivityType()
.withName(name.value())
.withVersion(version.value()))
.withActivityId(actionId.value())
.withTaskList(taskList)
.withInput(input.orElse(null))
.withControl(control.map(Control::value).orElse(null))
.withHeartbeatTimeout(heartbeatTimeout.orElse(null))
.withScheduleToCloseTimeout(scheduleToCloseTimeout.orElse(null))
.withScheduleToStartTimeout(scheduleToStartTimeout.orElse(null))
.withStartToCloseTimeout(startToCloseTimeout.orElse(null))
.withTaskPriority(taskPriorityString));
}
示例8: recordMarkerDecision
import org.immutables.builder.Builder; //导入依赖的package包/类
/**
* @return decision of type {@link DecisionType#RecordMarker}
*/
@Builder.Factory
public static Decision recordMarkerDecision(
@Nonnull ActionId actionId,
Optional<Details> details) {
return new Decision()
.withDecisionType(DecisionType.RecordMarker)
.withRecordMarkerDecisionAttributes(new RecordMarkerDecisionAttributes()
.withMarkerName(actionId.value())
.withDetails(details.map(Details::value).orElse(null)));
}
示例9: startTimerDecision
import org.immutables.builder.Builder; //导入依赖的package包/类
/**
* Create SWF {@link DecisionType#StartTimer} {@link Decision}.
*/
@Builder.Factory
public static Decision startTimerDecision(
@Nonnull ActionId actionId,
@Nonnull Duration startToFireTimeout,
Optional<Control> control) {
return new Decision()
.withDecisionType(DecisionType.StartTimer)
.withStartTimerDecisionAttributes(new StartTimerDecisionAttributes()
.withTimerId(actionId.value())
.withStartToFireTimeout(String.valueOf(startToFireTimeout.getSeconds()))
.withControl(control.map(Control::value).orElse(null)));
}
示例10: appl
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
public static int appl(Optional<Integer> a, java.util.Optional<String> b, java.util.OptionalInt c) {
return a.hashCode() + b.hashCode() + c.hashCode();
}
示例11: bbz
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
public static int bbz(@Builder.Parameter java.util.Optional<String> b, @Builder.Parameter java.util.OptionalInt c) {
return b.hashCode() + c.hashCode();
}
示例12: superstring
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
public static String superstring(int theory, String reality, @Nullable Void evidence) {
return theory + " != " + reality + ", " + evidence;
}
示例13: concat
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
public static Iterable<Object> concat(List<String> strings, @Value.NaturalOrder SortedSet<Integer> numbers) {
return Iterables.<Object>concat(strings, numbers);
}
示例14: sum
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
public static int sum(int a, int b) {
return a + b;
}
示例15: Pogo
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Constructor
public Pogo(@Builder.Parameter int a, String b, @Builder.Switch RetentionPolicy policy) {
this.a = a;
this.b = b;
this.policy = policy;
}