001/*
002 * Copyright (C) Cross The Road Electronics.  All rights reserved.
003 * License information can be found in CTRE_LICENSE.txt
004 * For support and suggestions contact support@ctr-electronics.com or file
005 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
006 */
007package com.ctre.phoenixpro.controls;
008
009import java.util.HashMap;
010import java.util.Map;
011
012/**
013 * Information about a control request.
014 * <p>
015 * This type contains a map that maps control parameter names to
016 * the corresponding applied value. Users can iterate through the map
017 * to look at the applied control parameters of the control request.
018 */
019public class ControlInfo {
020    private final Map<String, String> values = new HashMap<String, String>();
021
022    /**
023     * Constructs a new ControlInfo object for the control request of the given name.
024     * <p>
025     * This is constructed by the {@link ControlRequest} class and can be accessed by calling {@link ControlRequest#getControlInfo}.
026     *
027     * @param name Name of the control request
028     */
029    public ControlInfo(String name) {
030        values.put("name", name);
031    }
032
033    /**
034     * Gets the map of control parameter names to the corresponding applied value.
035     *
036     * @return Map of control parameter names and corresponding applied values
037     */
038    public Map<String, String> getNameValues() {
039        return values;
040    }
041}