<commit_before>package pl.grzeslowski.jsupla.protocol.decoders;

import pl.grzeslowski.jsupla.protocol.calltypes.CallType;
import pl.grzeslowski.jsupla.protocol.structs.ds.DeviceServer;

import static java.lang.String.format;
import static pl.grzeslowski.jsupla.protocol.calltypes.DeviceServerCallType.SUPLA_DS_CALL_REGISTER_DEVICE_B;

public class DecoderFactoryImpl implements DecoderFactory {
    private final TDS_SuplaDeviceChannel_BDecoder channelDecoder = new TDS_SuplaDeviceChannel_BDecoder();
    private final TDS_SuplaRegisterDevice_BDecoder registerDeviceDecoder =
            new TDS_SuplaRegisterDevice_BDecoder(channelDecoder);

    @SuppressWarnings("unchecked")
    @Override
    public <DS extends DeviceServer> Decoder<DS> getDecoderForCallType(CallType callType) {
        final int value = callType.getValue();
        if (value == SUPLA_DS_CALL_REGISTER_DEVICE_B.getValue()) {
            return (Decoder<DS>) registerDeviceDecoder;
        }
        throw new IllegalArgumentException(format("Don't know decoder for call type %s", callType));
    }
}<commit_msg>`Method type name 'DS' must match pattern '(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)'.`<commit_after>package pl.grzeslowski.jsupla.protocol.decoders;

import pl.grzeslowski.jsupla.protocol.calltypes.CallType;
import pl.grzeslowski.jsupla.protocol.structs.ds.DeviceServer;

import static java.lang.String.format;
import static pl.grzeslowski.jsupla.protocol.calltypes.DeviceServerCallType.SUPLA_DS_CALL_REGISTER_DEVICE_B;

public class DecoderFactoryImpl implements DecoderFactory {
    private final TDS_SuplaDeviceChannel_BDecoder channelDecoder = new TDS_SuplaDeviceChannel_BDecoder();
    private final TDS_SuplaRegisterDevice_BDecoder registerDeviceDecoder =
            new TDS_SuplaRegisterDevice_BDecoder(channelDecoder);

    @SuppressWarnings("unchecked")
    @Override
    public <T extends DeviceServer> Decoder<T> getDecoderForCallType(CallType callType) {
        final int value = callType.getValue();
        if (value == SUPLA_DS_CALL_REGISTER_DEVICE_B.getValue()) {
            return (Decoder<T>) registerDeviceDecoder;
        }
        throw new IllegalArgumentException(format("Don't know decoder for call type %s", callType));
    }
}
{'fraction_non_alphanumeric': 0.09066547565877624, 'fraction_numerical': 0.001786511835640911, 'mean_word_length': 5.070460704607046, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5047915', 'n_tokens_mistral': 696, 'n_tokens_neox': 695, 'n_words': 123}