Package: UserType
UserType
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
UserType(long, String, boolean, boolean) |
|
|
|
|
|
||||||||||||||||||||
accept(TypeVisitor) |
|
|
|
|
|
||||||||||||||||||||
accept(TypeVisitorException) |
|
|
|
|
|
||||||||||||||||||||
accept(TypeVisitorReturn) |
|
|
|
|
|
||||||||||||||||||||
accept(TypeVisitorReturnException) |
|
|
|
|
|
||||||||||||||||||||
isTheSameAs(Object) |
|
|
|
|
|
||||||||||||||||||||
toString() |
|
|
|
|
|
Coverage
1: package de.fhdw.wtf.persistence.meta;
2:
3: /**
4: * A class to represent an User Type. User Types are all types which are not base types.
5: *
6: */
7: public class UserType extends Type {
8:         
9:         /**
10:          * Constructor for a new User Type. It should only be called by the classfacade or a junit test case to guarantee
11:          * consistency with the database.
12:          *
13:          * @param id
14:          * The Id of the User Type.
15:          * @param name
16:          * The name of the User Type.
17:          * @param abs
18:          * A flag indicating whether the User type is abstract or not.
19:          * @param trans
20:          * A Flag indicating whether instance to this user Types are also transactions.
21:          */
22:         public UserType(final long id, final String name, final boolean abs, final boolean trans) {
23:                 super(id, name, abs, trans);
24:         }
25:         
26:         @Override
27:         public void accept(final TypeVisitor typeVisitor) {
28:                 typeVisitor.handleUserType(this);
29:                 
30:         }
31:         
32:         @Override
33:         public <X> X accept(final TypeVisitorReturn<X> typeVisitor) {
34:                 return typeVisitor.handleUserType(this);
35:         }
36:         
37:         @Override
38:         public <Exc extends Exception> void accept(final TypeVisitorException<Exc> typeVisitor) throws Exc {
39:                 typeVisitor.handleUserType(this);
40:         }
41:         
42:         @Override
43:         public <X, Y extends Exception> X accept(final TypeVisitorReturnException<X, Y> typeVisitorReturnException)
44:                         throws Y {
45:                 return typeVisitorReturnException.handleUserType(this);
46:         }
47:         
48:         @Override
49:         public String toString() {
50:                 return "(" + this.getId() + "," + this.getName() + "," + this.isAbs() + "," + this.isTrans() + ")";
51:         }
52:         
53:         @Override
54:         public boolean isTheSameAs(final java.lang.Object other) {
55:•                if (other instanceof UserType) {
56:                         final UserType type = (UserType) other;
57:                         
58:                         // Id is Unique for all UserTypes.
59:•                        return this.getId() == type.getId();
60:                 }
61:                 return false;
62:         }
63:         
64: }