001package jmri; 002 003import javax.annotation.CheckForNull; 004import javax.annotation.CheckReturnValue; 005import javax.annotation.Nonnull; 006 007/** 008 * Interface for obtaining VariableLights. 009 * <p> 010 * This doesn't have a "new" method, as all VariableLights is also located in 011 * LightManager. Use LightManager to add or create new VariableLights. 012 * <hr> 013 * This file is part of JMRI. 014 * <p> 015 * JMRI is free software; you can redistribute it and/or modify it under the 016 * terms of version 2 of the GNU General Public License as published by the Free 017 * Software Foundation. See the "COPYING" file for a copy of this license. 018 * <p> 019 * JMRI is distributed in the hope that it will be useful, but WITHOUT ANY 020 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 021 * A PARTICULAR PURPOSE. See the GNU General Public License for more details. 022 * 023 * @author Daniel Bergqvist Copyright (C) 2020 024 */ 025public interface VariableLightManager extends Manager<VariableLight> { 026 027 /** {@inheritDoc} */ 028 @Override 029 void dispose(); 030 031 /** 032 * Locate a VariableLight by its user name. 033 * 034 * @param s the user name 035 * @return the light or null if not found 036 */ 037 @CheckReturnValue 038 @CheckForNull 039 @Override 040 VariableLight getByUserName(@Nonnull String s); 041 042 /** 043 * Locate a VariableLight by its system name. 044 * 045 * @param s the system name 046 * @return the light or null if not found 047 */ 048 @CheckReturnValue 049 @CheckForNull 050 @Override 051 VariableLight getBySystemName(@Nonnull String s); 052 053}