Class StringItem
- All Implemented Interfaces:
- Identifiable<String>,- ActiveItem,- Item
- Author:
- Kai Kreuzer - Initial contribution
- 
Field SummaryFields inherited from class org.openhab.core.items.GenericItemcategory, eventPublisher, groupNames, itemStateConverter, label, lastState, lastStateChange, lastStateUpdate, listeners, name, state, tags, timeSeriesListeners, type
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionThis method provides a list of all command types that can be used for this itemThis method provides a list of all data types that can be used to update the item state<T extends State>
 @Nullable TgetStateAs(Class<T> typeClass) returns the current state of the item as a specific typevoidsend(StringType command) Send a StringType command to the item.voidsend(StringType command, @Nullable String source) Send a StringType command to the item.voidSet a new state.voidsetTimeSeries(TimeSeries timeSeries) Set a new time series.Methods inherited from class org.openhab.core.items.GenericItemaddGroupName, addGroupNames, addGroupNames, addStateChangeListener, addTag, addTags, addTags, addTimeSeriesListener, applyState, applyTimeSeries, dispose, equals, getCategory, getCommandDescription, getCommandOptions, getGroupNames, getLabel, getLastState, getLastStateChange, getLastStateUpdate, getName, getState, getStateDescription, getStateDescription, getTags, getType, getUID, hashCode, hasTag, internalSend, isAcceptedState, logSetTypeError, logSetTypeError, notifyListeners, removeAllTags, removeGroupName, removeStateChangeListener, removeTag, removeTimeSeriesListener, send, send, setCategory, setCommandDescriptionService, setEventPublisher, setItemStateConverter, setLabel, setState, setState, setStateDescriptionService, toStringMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openhab.core.items.ItemgetCommandDescription
- 
Constructor Details- 
StringItem
 
- 
- 
Method Details- 
sendSend a StringType command to the item.- Parameters:
- command- the command to be sent
 
- 
sendSend a StringType command to the item.- Parameters:
- command- the command to be sent
- source- the source of the command. See https://www.openhab.org/docs/developer/utils/events.html#the-core-events
 
- 
getAcceptedDataTypesDescription copied from interface:ItemThis method provides a list of all data types that can be used to update the item state Imagine e.g. a dimmer device: It's status could be 0%, 10%, 50%, 100%, but also OFF or ON and maybe UNDEFINED. So the accepted data types would be in this case PercentType, andUnDefTypeThe order of data types denotes the order of preference. So in case a state needs to be converted in order to be accepted, it will be attempted to convert it to a type from top to bottom. Therefore the type with the least information loss should be on top of the list - in the example above the PercentTypecarries more information than the , hence it is listed first.- Returns:
- a list of data types that can be used to update the item state
 
- 
getAcceptedCommandTypesDescription copied from interface:ItemThis method provides a list of all command types that can be used for this item Imagine e.g. a dimmer device: You could ask it to dim to 0%, 10%, 50%, 100%, but also to turn OFF or ON. So the accepted command types would be in this case PercentType,- Returns:
- a list of all command types that can be used for this item
 
- 
getStateAsDescription copied from interface:Itemreturns the current state of the item as a specific type- Specified by:
- getStateAsin interface- Item
- Overrides:
- getStateAsin class- GenericItem
- Returns:
- the current state in the requested type or null, if state cannot be provided as the requested type
 
- 
setStateDescription copied from class:GenericItemSet a new state. Subclasses may override this method in order to do necessary conversions upfront. Afterwards,GenericItem.applyState(State, String)should be called by classes overriding this method.- Overrides:
- setStatein class- GenericItem
- Parameters:
- state- new state of this item
- source- the source of the state update. See https://www.openhab.org/docs/developer/utils/events.html#the-core-events
 
- 
setTimeSeriesDescription copied from class:GenericItemSet a new time series. Subclasses may override this method in order to do necessary conversions upfront. Afterwards,GenericItem.applyTimeSeries(TimeSeries)should be called by classes overriding this method. A time series may only contain events that are compatible with the item's internal state.- Overrides:
- setTimeSeriesin class- GenericItem
- Parameters:
- timeSeries- new time series of this item
 
 
-