Class NegotiationMetadataExtractor

java.lang.Object
com.tnsai.coordination.negotiation.NegotiationMetadataExtractor

public final class NegotiationMetadataExtractor extends Object
Extracts NegotiationConfig from @Coordination.Negotiation annotation metadata.
Since:
0.0.2
  • Method Details

    • extract

      public static Optional<NegotiationConfig> extract(Class<?> clazz)
      Extracts negotiation config from a class annotated with @Coordination.
      Parameters:
      clazz - the annotated class
      Returns:
      the config, or empty if no negotiation configured
    • extract

      public static Optional<NegotiationConfig> extract(com.tnsai.annotations.Coordination.Negotiation negotiation)
      Extracts config from a @Coordination.Negotiation annotation.
      Parameters:
      negotiation - the annotation
      Returns:
      the config, or empty if type is NONE
    • resolveConcessionStrategy

      public static ConcessionStrategy resolveConcessionStrategy(String name)
      Resolves a concession strategy by name.
      Parameters:
      name - strategy name
      Returns:
      the strategy implementation
      Throws:
      IllegalArgumentException - if name is unknown