code: public DataPoint type(Type type) {
          if (this.type != type) {
              this.type = type;
              switch (type) {
              case AVERAGE:
              case SUM:
                  this.value = 0;
                  break;
              case MAXIMUM:
                  this.value = Long.MIN_VALUE;
                  break;
              case MINIMUM:
                  this.value = Long.MAX_VALUE;
                  break;
              default:
                  this.value = 0;
                  break;
              }
              this.numPoints = 0;
          }
          return this;
      }
docs: Setter
  
  @param type
  @return
  @since 0.3.0