blob: b4fc787443719e5fa343abe055c8369859349ba8 [file] [log] [blame]
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -08001package net.floodlightcontroller.util;
2
3/**
4 * The class representing an IPv4 address.
5 */
6public class IPv4 {
7 private int value;
8
9 /**
10 * Default constructor.
11 */
12 public IPv4() {
13 this.value = 0;
14 }
15
16 /**
17 * Constructor from an integer value.
18 *
19 * @param value the value to use.
20 */
21 public IPv4(int value) {
22 this.value = value;
23 }
24
25 /**
26 * Get the value of the IPv4 address.
27 *
28 * @return the value of the IPv4 address.
29 */
30 public int value() { return value; }
31
32 /**
33 * Set the value of the IPv4 address.
34 *
35 * @param value the value to set.
36 */
37 public void setValue(int value) {
38 this.value = value;
39 }
40
41 /**
42 * Convert the IPv4 value to a '.' separated string.
43 *
44 * @return the IPv4 value as a '.' separated string.
45 */
46 @Override
47 public String toString() {
48 String ret = "";
49 // TODO: Implement it!
50 return ret;
51 }
52}