Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Nov 13, 2024
1 parent bfde33a commit fec6ba4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,9 +25,8 @@
import org.springframework.util.StringUtils;

/**
* A data size, such as '12MB'.
*
* <p>This class models data size in terms of bytes and is immutable and thread-safe.
* A data size, such as '12MB'. This class models data size in terms of
* bytes and is immutable and thread-safe.
*
* <p>The terms and units used in this class are based on
* <a href="https://en.wikipedia.org/wiki/Binary_prefix">binary prefixes</a>
Expand Down Expand Up @@ -247,14 +246,14 @@ public String toString() {


@Override
public boolean equals(@Nullable Object obj) {
if (this == obj) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
if (other == null || getClass() != other.getClass()) {
return false;
}
DataSize that = (DataSize) obj;
DataSize that = (DataSize) other;
return (this.bytes == that.bytes);
}

Expand All @@ -279,7 +278,6 @@ private static DataUnit determineDataUnit(String suffix, @Nullable DataUnit defa
DataUnit defaultUnitToUse = (defaultUnit != null ? defaultUnit : DataUnit.BYTES);
return (StringUtils.hasLength(suffix) ? DataUnit.fromSuffix(suffix) : defaultUnitToUse);
}

}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -81,6 +81,7 @@ DataSize size() {
return this.size;
}


/**
* Return the {@link DataUnit} matching the specified {@code suffix}.
* @param suffix one of the standard suffixes
Expand Down

0 comments on commit fec6ba4

Please sign in to comment.