Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

The easiest way to solve this is with CollectionUtils.isEmpty.

Returns: true if empty or null

This way you can do it in one line.

When it comes to "attributes", there are design patterns that can help with this. Or, you can use Guava's Optional class. You can read more about it here: What's the point of Guava's Optional classWhat's the point of Guava's Optional class

The easiest way to solve this is with CollectionUtils.isEmpty.

Returns: true if empty or null

This way you can do it in one line.

When it comes to "attributes", there are design patterns that can help with this. Or, you can use Guava's Optional class. You can read more about it here: What's the point of Guava's Optional class

The easiest way to solve this is with CollectionUtils.isEmpty.

Returns: true if empty or null

This way you can do it in one line.

When it comes to "attributes", there are design patterns that can help with this. Or, you can use Guava's Optional class. You can read more about it here: What's the point of Guava's Optional class

Source Link
Daniel Kaplan
  • 68.4k
  • 60
  • 274
  • 413

The easiest way to solve this is with CollectionUtils.isEmpty.

Returns: true if empty or null

This way you can do it in one line.

When it comes to "attributes", there are design patterns that can help with this. Or, you can use Guava's Optional class. You can read more about it here: What's the point of Guava's Optional class