Tabnine Logo
Segment.matches
Code IndexAdd Tabnine to your IDE (free)

How to use
matches
method
in
org.axonframework.eventhandling.Segment

Best Java code snippets using org.axonframework.eventhandling.Segment.matches (Showing top 12 results out of 315)

origin: AxonFramework/AxonFramework

/**
 * Checks whether the given {@code sagaId} matches with the given {@code segment}.
 * <p>
 * For any complete set of segments, exactly one segment matches with any value.
 * <p>
 *
 * @param segment The segment to validate the identifier for
 * @param sagaId  The identifier to test
 * @return {@code true} if the identifier matches the segment, otherwise {@code false}
 *
 * @implSpec This implementation uses the {@link Segment#matches(Object)} to match against the Saga identifier
 */
protected boolean matchesSegment(Segment segment, String sagaId) {
  return segment.matches(sagaId);
}
origin: AxonFramework/AxonFramework

/**
 * Indicates whether the given {@code value} matches this segment. A value matches when the hashCode of a value,
 * after applying this segments mask, equals to this segment ID.
 *
 * @param value The value to verify against.
 * @return {@code true} if the given value matches this segment, otherwise {@code false}
 */
public boolean matches(Object value) {
  return mask == 0 || matches(Objects.hashCode(value));
}
origin: AxonFramework/AxonFramework

@Override
public boolean canHandle(EventMessage<?> eventMessage, Segment segment) {
  return hasHandler(eventMessage) && segment.matches(Objects.hashCode(getOrDefault(
      sequencingPolicy.getSequenceIdentifierFor(eventMessage),
      eventMessage::getIdentifier)
  ));
}
origin: AxonFramework/AxonFramework

private boolean shouldCreateSaga(Segment segment, boolean sagaInvoked,
                 SagaInitializationPolicy initializationPolicy) {
  return ((initializationPolicy.getCreationPolicy() == SagaCreationPolicy.ALWAYS
      || (!sagaInvoked && initializationPolicy.getCreationPolicy() == SagaCreationPolicy.IF_NONE_FOUND)))
      && segment.matches(initializationPolicy.getInitialAssociationValue());
}
origin: org.axonframework/axon-modelling

/**
 * Checks whether the given {@code sagaId} matches with the given {@code segment}.
 * <p>
 * For any complete set of segments, exactly one segment matches with any value.
 * <p>
 *
 * @param segment The segment to validate the identifier for
 * @param sagaId  The identifier to test
 * @return {@code true} if the identifier matches the segment, otherwise {@code false}
 *
 * @implSpec This implementation uses the {@link Segment#matches(Object)} to match against the Saga identifier
 */
protected boolean matchesSegment(Segment segment, String sagaId) {
  return segment.matches(sagaId);
}
origin: org.axonframework/axon-core

/**
 * Checks whether the given {@code sagaId} matches with the given {@code segment}.
 * <p>
 * For any complete set of segments, exactly one segment matches with any value.
 * <p>
 *
 * @param segment The segment to validate the identifier for
 * @param sagaId  The identifier to test
 * @return {@code true} if the identifier matches the segment, otherwise {@code false}
 *
 * @implSpec This implementation uses the {@link Segment#matches(Object)} to match against the Saga identifier
 */
protected boolean matchesSegment(Segment segment, String sagaId) {
  return segment.matches(sagaId);
}
origin: org.axonframework/axon-messaging

/**
 * Indicates whether the given {@code value} matches this segment. A value matches when the hashCode of a value,
 * after applying this segments mask, equals to this segment ID.
 *
 * @param value The value to verify against.
 * @return {@code true} if the given value matches this segment, otherwise {@code false}
 */
public boolean matches(Object value) {
  return mask == 0 || matches(Objects.hashCode(value));
}
origin: org.axonframework/axon-core

/**
 * Indicates whether the given {@code value} matches this segment. A value matches when the hashCode of a value,
 * after applying this segments mask, equals to this segment ID.
 *
 * @param value The value to verify against.
 * @return {@code true} if the given value matches this segment, otherwise {@code false}
 */
public boolean matches(Object value) {
  return mask == 0 || matches(Objects.hashCode(value));
}
origin: org.axonframework/axon-core

@Override
public boolean canHandle(EventMessage<?> eventMessage, Segment segment) {
  return hasHandler(eventMessage)
      && segment.matches(Objects.hashCode(getOrDefault(sequencingPolicy.getSequenceIdentifierFor(eventMessage),
                               eventMessage::getIdentifier)));
}
origin: org.axonframework/axon-messaging

@Override
public boolean canHandle(EventMessage<?> eventMessage, Segment segment) {
  return hasHandler(eventMessage) && segment.matches(Objects.hashCode(getOrDefault(
      sequencingPolicy.getSequenceIdentifierFor(eventMessage),
      eventMessage::getIdentifier)
  ));
}
origin: org.axonframework/axon-core

private boolean shouldCreateSaga(Segment segment, boolean sagaInvoked,
                 SagaInitializationPolicy initializationPolicy) {
  return ((initializationPolicy.getCreationPolicy() == SagaCreationPolicy.ALWAYS
      || (!sagaInvoked && initializationPolicy.getCreationPolicy() == SagaCreationPolicy.IF_NONE_FOUND)))
      && segment.matches(initializationPolicy.getInitialAssociationValue());
}
origin: org.axonframework/axon-modelling

private boolean shouldCreateSaga(Segment segment, boolean sagaInvoked,
                 SagaInitializationPolicy initializationPolicy) {
  return ((initializationPolicy.getCreationPolicy() == SagaCreationPolicy.ALWAYS
      || (!sagaInvoked && initializationPolicy.getCreationPolicy() == SagaCreationPolicy.IF_NONE_FOUND)))
      && segment.matches(initializationPolicy.getInitialAssociationValue());
}
org.axonframework.eventhandlingSegmentmatches

Javadoc

Returns true when the mask applied to the given value, matches the segment id.

Popular methods of Segment

  • getMask
    Getter for the segment mask.
  • <init>
  • computeSegments
    Compute the Segment's from a given list of segmentId's.
  • getSegmentId
    Getter for the segment identifier.
  • isMergeableWith
    Indicates whether this segment can be merged with the given other segment. Two segments can be merge
  • mergeableSegmentId
    Returns the #getSegmentId() of the segment this one can be merged with
  • split
    Returns an array with two Segment. The first entry contains the original segmentId, with the newly

Popular in Java

  • Parsing JSON documents to java classes using gson
  • putExtra (Intent)
  • requestLocationUpdates (LocationManager)
  • getSystemService (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now