title: Jackson: treat object as primitive
body: <p>I have a class which is more or less a wrapping class around a double. When I serialize my class via jackson I will receive something like: { "value" : 123.0 }. What I basically would like to happen is, that jackson gives me just 123.0. My problem would be solved if I could extend Number, but since I am already extending another class this is not an option.</p>
  
  <p>Class:</p>
  
  <pre><code>@JsonIgnoreProperties(ignoreUnknown = true)
  @SuppressWarnings("unused")
  public class TestValue {
      @JsonProperty
      private final Double d;
  
      public TestValue(Double d) {
          this.d = d;
      }
  }
  </code></pre>
  
  <p>Results in: </p>
  
  <pre><code>{
    "d" : 123.0
  }
  </code></pre>
  
  <p>What would work like expected:</p>
  
  <pre><code>public class TestValue extends Number {
      private final Double d;
  
      public TestValue(Double d) {
          this.d = d;
      }
  
      public double doubleValue() {
          return d;
      }
  
      public float floatValue() {
          return d.floatValue();
      }
  
      public int intValue() {
          return d.intValue();
      }
  
      public long longValue() {
          return d.longValue();
      }
  
      public String toString() {
          return d.toString();
      }
  }
  </code></pre>
  
  <p>.. which results in: 123.0</p>
  
  <p>But - you know - I am already extending an other abstract class. How can I get the expteced result?</p>