All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.mapsmessaging.devices.sensorreadings.ComputationResult Maven / Gradle / Ivy

The newest version!
package io.mapsmessaging.devices.sensorreadings;

import lombok.Getter;

@Getter
public class ComputationResult {

  private final T result;
  private final Exception error;

  private ComputationResult(T result, Exception error) {
    this.result = result;
    this.error = error;
  }

  public static  ComputationResult success(T result) {
    return new ComputationResult<>(result, null);
  }

  public static  ComputationResult failure(Exception error) {
    return new ComputationResult<>(null, error);
  }

  public boolean hasError() {
    return error != null;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy