<commit_before>package com.easternedgerobotics.rov.value;

public class ThrusterValue implements MutableValueCompanion<Thruster> {
    /**
     * Creates a ThrusterValue with the all the values zeroed out.
     *
     * @return a zero ThrusterValue
     */
    public static ThrusterValue zero() {
        return new ThrusterValue(new Thruster());
    }

    /**
     * Creates a ThrusterValue with the given values.
     *
     * @param name the logical name of the thruster
     * @param speed the desired speed to set the thruster
     * @param voltage the voltage read from the thruster
     * @param current the current read from the thruster
     * @param temperature the temperature read from the thruster
     * @return a ThrusterValue
     */
    public static ThrusterValue create(
        final String name,
        final float speed,
        final float voltage,
        final float current,
        final float temperature
    ) {
        final Thruster thruster = new Thruster();
        thruster.name = name;
        thruster.speed = speed;
        thruster.voltage = voltage;
        thruster.current = current;
        thruster.temperature = temperature;
        return new ThrusterValue(thruster);
    }

    public static ThrusterValue setSpeed(
        final ThrusterValue old,
        final float speed
    ) {
        final Thruster thruster = new Thruster();
        thruster.name = old.getName();
        thruster.speed = speed;
        thruster.voltage = old.getVoltage();
        thruster.current = old.getCurrent();
        thruster.temperature = old.getTemperature();
        return new ThrusterValue(thruster);
    }

    private final Thruster thruster;

    ThrusterValue(final Thruster thruster) {
        this.thruster = thruster;
    }

    public String getName() {
        return thruster.name;
    }

    public float getSpeed() {
        return thruster.speed;
    }

    public float getVoltage() {
        return thruster.voltage;
    }

    public float getCurrent() {
        return thruster.current;<commit_msg>Changing the setSpeed function from static to an instance method<commit_after>package com.easternedgerobotics.rov.value;

public class ThrusterValue implements MutableValueCompanion<Thruster> {
    /**
     * Creates a ThrusterValue with the all the values zeroed out.
     *
     * @return a zero ThrusterValue
     */
    public static ThrusterValue zero() {
        return new ThrusterValue(new Thruster());
    }

    /**
     * Creates a ThrusterValue with the given values.
     *
     * @param name the logical name of the thruster
     * @param speed the desired speed to set the thruster
     * @param voltage the voltage read from the thruster
     * @param current the current read from the thruster
     * @param temperature the temperature read from the thruster
     * @return a ThrusterValue
     */
    public static ThrusterValue create(
        final String name,
        final float speed,
        final float voltage,
        final float current,
        final float temperature
    ) {
        final Thruster thruster = new Thruster();
        thruster.name = name;
        thruster.speed = speed;
        thruster.voltage = voltage;
        thruster.current = current;
        thruster.temperature = temperature;
        return new ThrusterValue(thruster);
    }

    private final Thruster thruster;

    ThrusterValue(final Thruster thruster) {
        this.thruster = thruster;
    }


    public ThrusterValue setSpeed(
        final float speed
    ) {
        return ThrusterValue.create(
            thruster.name,
            speed,
            thruster.voltage,
            thruster.current,
            thruster.temperature
        );
    }

    public String getName() {
        return thruster.name;
    }

    public float getSpeed() {
        return thruster.speed;
    }

    public float getVoltage() {
        return thruster.voltage;
    }

    public float getCurrent() {
        return thruster.current;
{'fraction_non_alphanumeric': 0.06876719179794949, 'fraction_numerical': 0.0, 'mean_word_length': 2.2441200324412005, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4940237', 'n_tokens_mistral': 1104, 'n_tokens_neox': 1056, 'n_words': 341}