1 package org.apache.onami.autobind.jsr330;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 import static java.lang.String.format;
21
22 import java.io.Serializable;
23 import java.lang.annotation.Annotation;
24
25 import javax.inject.Named;
26
27 @SuppressWarnings( "all" )
28 class NamedImpl
29 implements Named, Serializable
30 {
31
32 private static final long serialVersionUID = 0;
33
34 private final String value;
35
36 public NamedImpl( String value )
37 {
38 this.value = value;
39 }
40
41 public String value()
42 {
43 return this.value;
44 }
45
46 public int hashCode()
47 {
48
49 return ( 127 * "value".hashCode() ) ^ value.hashCode();
50 }
51
52 public boolean equals( Object o )
53 {
54 if ( !( o instanceof Named ) )
55 {
56 return false;
57 }
58
59 Named other = (Named) o;
60 return value.equals( other.value() );
61 }
62
63 public String toString()
64 {
65 return format( "@%s(value=%s)", Named.class.getName(), value );
66 }
67
68 public Class<? extends Annotation> annotationType()
69 {
70 return Named.class;
71 }
72
73 }