ResourceSlot { public static ResourceSlot from(ITaskConfig task) { requireNonNull(task); return new ResourceSlot( task.getNumCpus(), Amount.of(task.getRamMb(), Data.MB), Amount.of(task.getDiskMb(), Data.MB), task.getRequestedPorts().size()); } ResourceSlot(
      double numCpus,
      Amount<Long, Data> ram,
      Amount<Long, Data> disk,
      int numPorts); static ResourceSlot from(ITaskConfig task); static TaskInfo matchResourceTypes(TaskInfo task); List<Protos.Resource> toResourceList(TierInfo tierInfo); @VisibleForTesting static Protos.Resource makeMesosRangeResource(
      ResourceType resourceType,
      Set<Integer> values); double getNumCpus(); Amount<Long, Data> getDisk(); Amount<Long, Data> getRam(); int getNumPorts(); @Override boolean equals(Object o); @Override int hashCode(); static ResourceSlot sum(Iterable<ResourceSlot> slots); ResourceSlot add(ResourceSlot other); ResourceSlot subtract(ResourceSlot other); static final ResourceSlot NONE; static final Function<Range<Integer>, Protos.Value.Range> RANGE_TRANSFORM; static final Ordering<ResourceSlot> ORDER; }
@Test public void testEqualsBadType() { ResourceSlot resources = ResourceSlot.from(TASK); assertNotEquals(resources, "Hello"); assertNotEquals(resources, null); }