mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

matthew_swift
04.49.2009 9fdb95ca9c3c8e3524845760b81a85c7a4c81a45
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
package org.opends.sdk.controls;
 
 
 
import org.opends.sdk.ByteString;
 
 
 
/**
 * Created by IntelliJ IDEA. User: boli Date: Jun 29, 2009 Time:
 * 10:59:19 AM To change this template use File | Settings | File
 * Templates.
 */
public abstract class Control
{
  // The criticality for this control.
  protected final boolean isCritical;
 
  // The OID for this control.
  protected final String oid;
 
 
 
  public Control(String oid, boolean isCritical)
  {
    this.isCritical = isCritical;
    this.oid = oid;
  }
 
 
 
  /**
   * Retrieves the OID for this control.
   * 
   * @return The OID for this control.
   */
  public String getOID()
  {
    return oid;
  }
 
 
 
  public abstract ByteString getValue();
 
 
 
  public abstract boolean hasValue();
 
 
 
  /**
   * Indicates whether this control should be considered critical in
   * processing the request.
   * 
   * @return <CODE>true</CODE> if this code should be considered
   *         critical, or <CODE>false</CODE> if not.
   */
  public boolean isCritical()
  {
    return isCritical;
  }
 
 
 
  /**
   * {@inheritDoc}
   */
  @Override
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
 
 
 
  public abstract void toString(StringBuilder buffer);
}