View Javadoc

1   package com.atlassian.marketplace.client.encoding;
2   
3   import static com.google.common.base.Preconditions.checkNotNull;
4   
5   /**
6    * Indicates that an object returned by the server (or constructed by the caller) was invalid
7    * because a required link relation was omitted.
8    * @since 2.0.0
9    */
10  public class MissingRequiredLink extends SchemaViolation
11  {
12      private final String rel;
13      
14      public MissingRequiredLink(Class<?> schemaClass, String rel)
15      {
16          super(schemaClass);
17          this.rel = checkNotNull(rel);
18      }
19      
20      /**
21       * The link relation string of the link that was not found.
22       */
23      public String getRel()
24      {
25          return rel;
26      }
27      
28      @Override
29      public String getMessage()
30      {
31          return "missing required link \"" + rel + "\" in " + getSchemaClass().getSimpleName();
32      }
33  }