Main conversion method.

@param value
481321
@Override
    public GetHeadendsResult convert(Map<String, Headend> value) {
        GetHeadendsResult r = new GetHeadendsResult();
        r.setHeadends(value);
        return r;
    }
947160
static void validateHeaderValue(CharSequence value) {
        if (value == null) {
            throw new NullPointerException("value");
        }
        for (int i = 0; i < value.length(); i ++) {
            char c = value.charAt(i);
            if (c == 0) {
                throw new IllegalArgumentException(
                        "value contains null character: " + value);
            }
        }
    }
883978
@Override public Object transform(Object value) {
        if (value == null) {
            return value;
        } else if (value instanceof Boolean) {
            return value;
        } else if (value instanceof String) {
            return value;
        } else if (value instanceof Number) {
            return InternalUtils.toBigDecimal((Number)value);
        } else if (value instanceof byte[]) {
            return value;
        } else if (value instanceof ByteBuffer) {
            return copyBytesFrom((ByteBuffer)value);
        } else if (value instanceof Set) {
            @SuppressWarnings("unchecked")
            Set<Object> set = (Set<Object>) value;
            if (set.size() == 0)
                return value;
            Object element = set.iterator().next();
            if (element instanceof String) {
                return value;
            } else if (element instanceof BigDecimal) {
                return value;
            } else if (element instanceof Number) {
                @SuppressWarnings("unchecked")
                Set<Number> in = (Set<Number>) value;
                Set<BigDecimal> out = new LinkedHashSet<BigDecimal>(set.size());
                for (Number n : in)
                    out.add(InternalUtils.toBigDecimal(n));
                return out;
            } else if (element instanceof byte[]) {
                return value;
            } else if (element instanceof ByteBuffer) {
                @SuppressWarnings("unchecked")
                Set<ByteBuffer> bs = (Set<ByteBuffer>) value;
                Set<byte[]> out = new LinkedHashSet<byte[]>(bs.size());
                for (ByteBuffer bb: bs)
                    out.add(copyBytesFrom(bb));
                return out;
            } else {
                throw new UnsupportedOperationException("element type: "
                        + element.getClass());
            }
        } else if (value instanceof List) {
            @SuppressWarnings("unchecked")
            List<Object> in = (List<Object>) value;
            if (in.size() == 0)
                return in;
            List<Object> out = new ArrayList<Object>();
            for (Object v : in)
                out.add(transform(v));
            return out;
        } else if (value instanceof Map) {
            @SuppressWarnings("unchecked")
            Map<String, Object> in = (Map<String, Object>) value;
            if (in.size() == 0)
                return in;
            Map<String, Object> out = new LinkedHashMap<String, Object>(in.size());
            for (Map.Entry<String, Object> e : in.entrySet())
                out.put(e.getKey(), transform(e.getValue()));
            return out;
        } else {
            throw new UnsupportedOperationException("value type: "
                    + value.getClass());
        }
    }
108313
public void setValue(Object value) {
    if (value instanceof Iterable<?>) {
      this.value = stream((Iterable<?>) value).map(this::toValue).collect(toList());
    } else {
      this.value = toValue(value);
    }
  }
379675
public Double convertToDouble(String value) {
        Double result = null;
        if (value != null) {
            result = Double.valueOf(value);
        }
        return result;
    }
1217982
public Object convert(Class<?> targetType, Object value) {
        if (value == null) {
            return null;
        }

        Converter converter = getConverter(value.getClass(), targetType);
        if (converter == null) {
            throw new IllegalArgumentException(
                    "No converter from " + value.getClass() + " to " + targetType.getName());
        } else {
            return converter.convert(targetType, value);
        }
    }
7489
private void updateValue(Value value) {
    while (true) {
      Value current = currentValue.get();
      if (value.isNewerThan(current)) {
        if (currentValue.compareAndSet(current, value)) {
          if (current == null || !Objects.equals(current.value(), value.value())) {
            eventListeners.forEach(listener -> listener.event(new ValueDelegateEvent<>(ValueDelegateEvent.Type.UPDATE, decode(value.value()))));
          }
          break;
        }
      } else {
        break;
      }
    }
  }
1283046
private void appendValue(Object value) {
        if (value instanceof Boolean) {
            closeTag();
            append(value.toString());
        } else if (value instanceof Number) {
            closeTag();
            append(value.toString());
        } else if (value instanceof String) {
            closeTag();
            escape((String) value);
        } else if (value instanceof MwsObject) {
            ((MwsObject) value).writeFragmentTo(this);
        } else if (value instanceof Node) {
            closeTag();
            append(MwsUtl.toXmlString((Node) value));
        } else if (value instanceof Enum) {
            closeTag();
            append(((Enum<?>) value).toString());
        } else if (value instanceof XMLGregorianCalendar) {
            closeTag();
            append(((XMLGregorianCalendar) value).toXMLFormat());
        } else {
            throw new IllegalArgumentException();
        }
    }
767569
public static Object convertToJava(Value value) {
        switch (value.getType()) {
            case STRING:
                return ((StringValue) value).get();
            case BOOLEAN:
                return ((BooleanValue) value).get();
            case NUMBER:
                return ((NumberValue) value).get();
            case DATE:
                return ((DateValue) value).get();
            case NIL:
                return null;
            case OBJECT:
                return value.get();
        }
        throw new CommandExecutionException("Could not convert value " + value + " to an equivalent Java object");
    }
276889
@Override
    public void accept(double value)
    {
        writeLock.lock();
        try
        {
            eliminate();
            int count = count();
            if (count >= size)
            {
                grow();
            }
            assign(endMod(), value);
            endIncr();
        }
        finally
        {
            writeLock.unlock();
        }
    }
29089
@Override
    public Object convertUponGet(
                    final Object value
                    )
    {
        if (value == null) {
            return null;
        }

        return _formatter.format( (Date)value );
    }
1142427
public void set(T value) {
        EventImpl event = (EventImpl) CurrentEvent.get();
        if (null != event) {
            event.set(this, value);
        }
    }
1368855
protected void setValue(Object value) {
        this.value = value;
        serializedValue = null;
        timeStamp = System.currentTimeMillis();
        this.valueHashcode = 0;
    }
691074
private void appendValue(Object value) {
        if (value == null) {
            append("null");
        } else if (value instanceof MwsObject) {
            append("{");
            needComma = false;
            ((MwsObject) value).writeFragmentTo(this);
            append("}");
        } else if (value instanceof Boolean || value instanceof Number) {
            append(value.toString());
        } else if (value instanceof String) {
            append("\"");
            escape((String) value);
            append("\"");
        } else if (value instanceof Node) {
            appendValue(MwsUtl.toXmlString((Node) value));
        } else if (value instanceof XMLGregorianCalendar) {
            append(((XMLGregorianCalendar) value).toXMLFormat());
        } else if (value instanceof Enum) {
            append(value.toString());
        } else {
            throw new IllegalArgumentException("Unsupported type "+value.getClass().getName());
        }
        needComma = true;
    }
675017
@Override
	public void setValue(StringValue value) {
		checkNotNull(value);
		setValue(value.value, 0, value.len);
	}
88974
public void setAsObject(Object value) {
		clear();
		Map<String, Object> values = MapConverter.toMap(value);
		append(values);
	}
890491
@Override
    public void setValue(final double VALUE) {
        if (isEnabled()) {
            this.value100 = (VALUE % 1000) / 100;
            this.value1000 = (VALUE % 10000) / 100;
            this.value10000 = (VALUE % 100000) / 100;

            if (isValueCoupled()) {
                setLcdValue(VALUE);
            }

            fireStateChanged();
            this.oldValue = VALUE;
            repaint();
        }
    }