1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.directory.api.ldap.extras.extended.storedProcedure;
21
22
23 import org.apache.directory.api.util.Strings;
24
25
26
27
28
29
30
31 public class StoredProcedureParameter
32 {
33
34 private byte[] type;
35
36
37 private byte[] value;
38
39
40
41
42
43
44
45 public String getTypeString()
46 {
47 return Strings.utf8ToString( type );
48 }
49
50
51
52
53
54
55
56 public String getValueString()
57 {
58 return Strings.utf8ToString( value );
59 }
60
61
62
63
64
65
66
67 public byte[] getType()
68 {
69 if ( type == null )
70 {
71 return null;
72 }
73
74 final byte[] copy = new byte[type.length];
75 System.arraycopy( type, 0, copy, 0, type.length );
76 return copy;
77 }
78
79
80
81
82
83
84
85 public void setType( byte[] type )
86 {
87 if ( type != null )
88 {
89 this.type = new byte[type.length];
90 System.arraycopy( type, 0, this.type, 0, type.length );
91 }
92 else
93 {
94 this.type = null;
95 }
96 }
97
98
99
100
101
102
103
104 public byte[] getValue()
105 {
106 if ( value == null )
107 {
108 return null;
109 }
110
111 final byte[] copy = new byte[value.length];
112 System.arraycopy( value, 0, copy, 0, value.length );
113 return copy;
114 }
115
116
117
118
119
120
121
122 public void setValue( byte[] value )
123 {
124 if ( value != null )
125 {
126 this.value = new byte[value.length];
127 System.arraycopy( value, 0, this.value, 0, value.length );
128 }
129 else
130 {
131 this.value = null;
132 }
133 }
134 }