BUG-3907: openflow-plugin-api does not build with jdk8
[openflowjava.git] / openflow-protocol-api / src / main / java / org / opendaylight / openflowjava / protocol / api / util / BinContent.java
1 /*
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowjava.protocol.api.util;
10
11 /**
12  * @author michal.polkorab
13  *
14  */
15 public abstract class BinContent {
16
17     private BinContent() {
18         //not called
19     }
20
21     /**
22      * @param value input integer value (might be negative)
23      * @return int part wrapped in long (always positive)
24      */
25     public static long intToUnsignedLong(int value) {
26         return value & 0x00000000ffffffffL;
27     }
28
29     /**
30      * @param value input long value
31      * @return long cut into int
32      */
33     public static int longToSignedInt(long value) {
34         return (int) value;
35     }
36 }