@Override
 public JsonElement serialize(EOwnState state, Type arg1, JsonSerializationContext arg2) {
   return new JsonPrimitive(state.ordinal());
 }
 @Override
 public EOwnState deserialize(JsonElement json, Type type, JsonDeserializationContext context)
     throws JsonParseException {
   if (json.getAsInt() < EOwnState.values().length) return EOwnState.values()[json.getAsInt()];
   return null;
 }