public List<Method> select(final Class<?> clazz) { final Method[] methods = clazz.getMethods(); final Set<String> sortedMethodNames = getSortedMethods(clazz, methods); final Map<String, Method> sortedMethods = new HashMap<>(); final List<Method> unsortedMethods = new ArrayList<>(); for (final Method method : methods) { selectMethod(sortedMethodNames, sortedMethods, unsortedMethods, method); } for (final String name : sortedMethodNames) { unsortedMethods.add(sortedMethods.get(name)); } return unsortedMethods; }
private Set<String> getSortedMethods(final Class<?> clazz, final Method[] methods) { final Set<String> sortedMethodNames = sortedMethods.get(clazz); if (sortedMethodNames == null) { final GroupOrder order = clazz.getAnnotation(GroupOrder.class); if (order == null) { sortedMethods.put(clazz, Collections.emptySet()); return Collections.emptySet(); } else { final Set<String> result = new LinkedHashSet<>(); for (final Class<?> groupClazz : order.value()) { for (final Method method : methods) { if (method.getReturnType() == groupClazz && method.getParameterTypes().length == 0) { result.add(method.getName()); } } } sortedMethods.put(clazz, result); return result; } } return sortedMethodNames; }
public TokenCodecEncoder fieldId(final int value) { CodecUtil.int32Put(buffer, offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN); return this; }
public int tokenVersion() { return CodecUtil.int32Get(buffer, offset + 12, java.nio.ByteOrder.LITTLE_ENDIAN); }
public MessageHeaderEncoder blockLength(final int value) { CodecUtil.uint16Put(buffer, offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); return this; }
public VarDataEncodingEncoder length(final short value) { CodecUtil.uint8Put(buffer, offset + 0, value); return this; }
public short length() { return CodecUtil.uint8Get(buffer, offset + 0); }
public TokenCodecEncoder tokenOffset(final int value) { CodecUtil.int32Put(buffer, offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); return this; }
public int tokenOffset() { return CodecUtil.int32Get(buffer, offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); }
public MessageHeaderEncoder schemaId(final int value) { CodecUtil.uint16Put(buffer, offset + 4, value, java.nio.ByteOrder.LITTLE_ENDIAN); return this; }
public FrameCodecEncoder irId(final int value) { CodecUtil.int32Put(buffer, offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); return this; }
public int fieldId() { return CodecUtil.int32Get(buffer, offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); }
public MessageHeaderEncoder templateId(final int value) { CodecUtil.uint16Put(buffer, offset + 2, value, java.nio.ByteOrder.LITTLE_ENDIAN); return this; }
public FrameCodecEncoder schemaVersion(final int value) { CodecUtil.int32Put(buffer, offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN); return this; }
public int irVersion() { return CodecUtil.int32Get(buffer, offset + 4, java.nio.ByteOrder.LITTLE_ENDIAN); }
public MessageHeaderEncoder version(final int value) { CodecUtil.uint16Put(buffer, offset + 6, value, java.nio.ByteOrder.LITTLE_ENDIAN); return this; } }
public TokenCodecEncoder tokenSize(final int value) { CodecUtil.int32Put(buffer, offset + 4, value, java.nio.ByteOrder.LITTLE_ENDIAN); return this; }
public int schemaVersion() { return CodecUtil.int32Get(buffer, offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); }
public TokenCodecEncoder tokenVersion(final int value) { CodecUtil.int32Put(buffer, offset + 12, value, java.nio.ByteOrder.LITTLE_ENDIAN); return this; } public TokenCodecEncoder signal(final SignalCodec value)
public FrameCodecEncoder irVersion(final int value) { CodecUtil.int32Put(buffer, offset + 4, value, java.nio.ByteOrder.LITTLE_ENDIAN); return this; }