Commit 404aa70f authored by Andre Freyssinet's avatar Andre Freyssinet
Browse files

Code cleaning.

parent 8c662411
/*
* Copyright (C) 2013 - 2017 ScalAgent Distributed Technologies
* Copyright (C) 2013 - 2022 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -27,7 +27,7 @@ import java.io.Serializable;
* Encodable object that wraps an integer.
*/
@SuppressWarnings("serial")
public class EncodableInteger implements Encodable, Serializable {
public final class EncodableInteger implements Encodable, Serializable {
private int value;
public EncodableInteger() {}
......@@ -48,18 +48,22 @@ public class EncodableInteger implements Encodable, Serializable {
return value++;
}
@Override
public int getEncodableClassId() {
return EncodableFactoryRepository.ENCODABLE_INTEGER_CLASS_ID;
}
@Override
public int getEncodedSize() throws Exception {
return 4;
return Encodable.INT_ENCODED_SIZE;
}
@Override
public void encode(Encoder encoder) throws Exception {
encoder.encode32(value);
}
@Override
public void decode(Decoder decoder) throws Exception {
value = decoder.decode32();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment