本文整理汇总了Java中org.immutables.builder.Builder类的典型用法代码示例。如果您正苦于以下问题:Java Builder类的具体用法?Java Builder怎么用?Java Builder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Builder类属于org.immutables.builder包,在下文中一共展示了Builder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:fzakaria,项目名称:WaterFlow,代码行数:28,代码来源:SwfRequests.java
示例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;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:GenericsImprovisedFactories.java
示例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;
}
开发者ID:tudorv91,项目名称:SparkJNI,代码行数:15,代码来源:SparkJni.java
示例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());
}
开发者ID:fzakaria,项目名称:WaterFlow,代码行数:34,代码来源:SwfRequests.java
示例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());
}
开发者ID:fzakaria,项目名称:WaterFlow,代码行数:15,代码来源:SwfRequests.java
示例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));
}
开发者ID:fzakaria,项目名称:WaterFlow,代码行数:9,代码来源:SwfRequests.java
示例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));
}
开发者ID:fzakaria,项目名称:WaterFlow,代码行数:36,代码来源:SwfDecisions.java
示例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)));
}
开发者ID:fzakaria,项目名称:WaterFlow,代码行数:14,代码来源:SwfDecisions.java
示例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)));
}
开发者ID:fzakaria,项目名称:WaterFlow,代码行数:16,代码来源:SwfDecisions.java
示例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();
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:JdkOptionalBuilderFactory.java
示例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();
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:JdkOptionalBuilderFactory.java
示例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;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:ImprovisedFactories.java
示例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);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:ImprovisedFactories.java
示例14: sum
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
public static int sum(int a, int b) {
return a + b;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:ImprovisedFactories.java
示例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;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:Pogo.java
示例16: factory1
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
public static String factory1(int theory, String reality, @Nullable @Builder.Parameter Void evidence) {
return theory + " != " + reality + ", " + evidence;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:FactoryParametersAndSwitchers.java
示例17: factory2
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
public static String factory2(@Builder.Parameter int theory, @Builder.Parameter String reality) {
return theory + " != " + reality;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:FactoryParametersAndSwitchers.java
示例18: throwing
import org.immutables.builder.Builder; //导入依赖的package包/类
@SuppressWarnings("unused")
@Builder.Factory
public static String throwing() throws Exception, Error {
throw new Exception();
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:FactoryParametersAndSwitchers.java
示例19: factory3
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
public static String factory3(@Builder.Parameter int theory, String reality) {
return theory + " != " + reality;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:FactoryParametersAndSwitchers.java
示例20: factory4
import org.immutables.builder.Builder; //导入依赖的package包/类
@Builder.Factory
public static String factory4(@Builder.Parameter int value, @Builder.Switch RetentionPolicy policy) {
return policy + "" + value;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:FactoryParametersAndSwitchers.java
注:本文中的org.immutables.builder.Builder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论