Class ImmutableJobBatchRecordValue
java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableJobBatchRecordValue
- All Implemented Interfaces:
JsonSerializable,RecordValue,JobBatchRecordValue
@ParametersAreNonnullByDefault
@Immutable
public final class ImmutableJobBatchRecordValue
extends Object
implements JobBatchRecordValue
Immutable implementation of
JobBatchRecordValue.
Use the builder to create immutable instances:
ImmutableJobBatchRecordValue.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableJobBatchRecordValue. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableJobBatchRecordValue.static ImmutableJobBatchRecordValuecopyOf(JobBatchRecordValue instance) Creates an immutable copy of aJobBatchRecordValuevalue.booleanThis instance is equal to all instances ofImmutableJobBatchRecordValuethat have equal attribute values.getJobs()intlonggetType()inthashCode()Returns a lazily computed hash code from attributes:type,worker,timeout,maxJobsToActivate,jobKeys,jobs,truncated.booleantoString()Prints the immutable valueJobBatchRecordValuewith attribute values.withJobKeys(Iterable<? extends Long> elements) Copy the current immutable object with elements that replace the content ofjobKeys.withJobKeys(Long... elements) Copy the current immutable object with elements that replace the content ofjobKeys.withJobs(JobRecordValue... elements) Copy the current immutable object with elements that replace the content ofjobs.withJobs(Iterable<? extends JobRecordValue> elements) Copy the current immutable object with elements that replace the content ofjobs.withMaxJobsToActivate(int value) Copy the current immutable object by setting a value for themaxJobsToActivateattribute.withTimeout(long value) Copy the current immutable object by setting a value for thetimeoutattribute.withTruncated(boolean value) Copy the current immutable object by setting a value for thetruncatedattribute.Copy the current immutable object by setting a value for thetypeattribute.withWorker(String value) Copy the current immutable object by setting a value for theworkerattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.camunda.zeebe.protocol.record.JsonSerializable
toJson
-
Method Details
-
getType
- Specified by:
getTypein interfaceJobBatchRecordValue- Returns:
- the type of the job
-
getWorker
- Specified by:
getWorkerin interfaceJobBatchRecordValue- Returns:
- the assigned worker to complete the job
-
getTimeout
public long getTimeout()- Specified by:
getTimeoutin interfaceJobBatchRecordValue- Returns:
- the timeout (time span in milliseconds) for which a job is exclusively assigned to this worker. If the timeout is exceeded, it can happen that the job is handed to another worker and the work is performed twice.
-
getMaxJobsToActivate
public int getMaxJobsToActivate()- Specified by:
getMaxJobsToActivatein interfaceJobBatchRecordValue- Returns:
- the number of jobs to handle
-
getJobKeys
- Specified by:
getJobKeysin interfaceJobBatchRecordValue- Returns:
- list of the keys from the jobs assigned to this batch
-
getJobs
- Specified by:
getJobsin interfaceJobBatchRecordValue- Returns:
- the jobs assigned to this batch
-
isTruncated
public boolean isTruncated()- Specified by:
isTruncatedin interfaceJobBatchRecordValue- Returns:
- the broker has more JobRecords that couldn't fit in this batch
-
withType
Copy the current immutable object by setting a value for thetypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type (can benull)- Returns:
- A modified copy of the
thisobject
-
withWorker
Copy the current immutable object by setting a value for theworkerattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for worker (can benull)- Returns:
- A modified copy of the
thisobject
-
withTimeout
Copy the current immutable object by setting a value for thetimeoutattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for timeout- Returns:
- A modified copy of the
thisobject
-
withMaxJobsToActivate
Copy the current immutable object by setting a value for themaxJobsToActivateattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for maxJobsToActivate- Returns:
- A modified copy of the
thisobject
-
withJobKeys
Copy the current immutable object with elements that replace the content ofjobKeys.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withJobKeys
Copy the current immutable object with elements that replace the content ofjobKeys. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of jobKeys elements to set- Returns:
- A modified copy of
thisobject
-
withJobs
Copy the current immutable object with elements that replace the content ofjobs.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withJobs
Copy the current immutable object with elements that replace the content ofjobs. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of jobs elements to set- Returns:
- A modified copy of
thisobject
-
withTruncated
Copy the current immutable object by setting a value for thetruncatedattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for truncated- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableJobBatchRecordValuethat have equal attribute values. -
hashCode
public int hashCode()Returns a lazily computed hash code from attributes:type,worker,timeout,maxJobsToActivate,jobKeys,jobs,truncated. -
toString
Prints the immutable valueJobBatchRecordValuewith attribute values. -
copyOf
Creates an immutable copy of aJobBatchRecordValuevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable JobBatchRecordValue instance
-
builder
Creates a builder forImmutableJobBatchRecordValue.ImmutableJobBatchRecordValue.builder() .withType(String | null) // nullabletype.withWorker(String | null) // nullableworker.withTimeout(long) // optionaltimeout.withMaxJobsToActivate(int) // optionalmaxJobsToActivate.addJobKey|addAllJobKeys(Long) //jobKeyselements .addJob|addAllJobs(io.camunda.zeebe.protocol.record.value.JobRecordValue) //jobselements .withTruncated(boolean) // optionaltruncated.build();- Returns:
- A new ImmutableJobBatchRecordValue builder
-