@Override public int hashCode() {
    int result = topic != null ? topic.hashCode() : 0;
    result = 31 * result + (replicas != null ? replicas.hashCode() : 0);
    result = 31 * result + (taskCount != null ? taskCount.hashCode() : 0);
    result = 31 * result + (taskDuration != null ? taskDuration.hashCode() : 0);
    result = 31 * result + (consumerProperties != null ? consumerProperties.hashCode() : 0);
    result = 31 * result + (startDelay != null ? startDelay.hashCode() : 0);
    result = 31 * result + (period != null ? period.hashCode() : 0);
    result = 31 * result + (useEarliestOffset ? 1 : 0);
    result = 31 * result + (completionTimeout != null ? completionTimeout.hashCode() : 0);
    result = 31 * result + (lateMessageRejectionPeriod.isPresent() ? lateMessageRejectionPeriod.hashCode() : 0);
    result = 31 * result + (earlyMessageRejectionPeriod.isPresent() ? earlyMessageRejectionPeriod.hashCode() : 0);
    result = 31 * result + (skipOffsetGaps ? 1 : 0);
    return result;
  }
This class is copied from druid source code
in order to avoid adding additional dependencies on druid-indexing-service.
druid-handler/src/java/org/apache/hadoop/hive/druid/json/KafkaSupervisorIOConfig.java