/
dataColumnConstraintsKey.ts
85 lines (74 loc) · 1.66 KB
/
dataColumnConstraintsKey.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/**
* DataColumnConstraintsKey complex primary key
*/
export class DataColumnConstraintsKey {
private constraint_name: string;
private constraint_type: string;
private value: string;
/**
* Constructor
* @param constraintName
* @param constraintType
* @param value
*/
public constructor(constraintName: string, constraintType: string, value: string) {
this.constraint_name = constraintName;
this.constraint_type = constraintType;
this.value = value;
}
/**
* Set constraint name
* @param constraintName
*/
public setConstraintName(constraintName: string): void {
this.constraint_name = constraintName;
}
/**
* Get constraint name
*/
public getConstraintName(): string {
return this.constraint_name;
}
/**
* Set constraint type
* @param constraintType
*/
public setConstraintType(constraintType: string): void {
this.constraint_type = constraintType;
}
/**
* Get constraint type
*/
public getConstraintType(): string {
return this.constraint_type;
}
/**
* Set column value
* @param value
*/
public setValue(value: string): void {
this.value = value;
}
/**
* Get column value
*/
public getValue(): string {
return this.value;
}
/**
* @inheritDoc
*/
public toString(): string {
return this.constraint_name + ':' + this.constraint_type + ':' + this.value;
}
/**
* @inheritDoc
*/
public equals(obj: DataColumnConstraintsKey): boolean {
return (
this.getConstraintType() === obj.getConstraintName() &&
this.getConstraintType() === obj.getConstraintType() &&
this.getValue() === obj.getValue()
);
}
}