blob: bf1fc7d4ba2f40bc6baadfeb27fa8794c9126fd7 [file] [log] [blame]
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -08001package net.floodlightcontroller.util;
2
Pavlin Radoslavovad008e02013-02-21 18:42:42 -08003import net.floodlightcontroller.util.serializers.FlowEntryIdSerializer;
4
5import org.codehaus.jackson.annotate.JsonProperty;
6import org.codehaus.jackson.map.annotate.JsonSerialize;
7
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -08008/**
9 * The class representing a Flow Entry ID.
10 */
Pavlin Radoslavovad008e02013-02-21 18:42:42 -080011@JsonSerialize(using=FlowEntryIdSerializer.class)
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080012public class FlowEntryId {
13 private long value;
14
15 /**
16 * Default constructor.
17 */
18 public FlowEntryId() {
19 this.value = 0;
20 }
21
22 /**
23 * Constructor from an integer value.
24 *
25 * @param value the value to use.
26 */
27 public FlowEntryId(long value) {
28 this.value = value;
29 }
30
31 /**
32 * Get the value of the Flow Entry ID.
33 *
34 * @return the value of the Flow Entry ID.
35 */
36 public long value() { return value; }
37
38 /**
39 * Set the value of the Flow Entry ID.
40 *
41 * @param value the value to set.
42 */
43 public void setValue(long value) {
44 this.value = value;
45 }
46
47 /**
Pavlin Radoslavovad008e02013-02-21 18:42:42 -080048 * Convert the Flow Entry ID value to a hexadecimal string.
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080049 *
Pavlin Radoslavovad008e02013-02-21 18:42:42 -080050 * @return the Flow Entry ID value to a hexadecimal string.
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080051 */
52 @Override
53 public String toString() {
Pavlin Radoslavovad008e02013-02-21 18:42:42 -080054 return Long.toHexString(this.value);
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080055 }
56}