Class StreamExamples.User

java.lang.Object
net.jrodolfo.java_evolution.java08.StreamExamples.User
Enclosing class:
StreamExamples

public static class StreamExamples.User extends Object
Small Java 8-style data class used by the stream examples.

This deliberately avoids records because records were introduced much later, in Java 16.

  • Constructor Details

    • User

      public User(String name, int age, String department, boolean active)
      Creates a user for stream-processing examples.
      Parameters:
      name - the user's display name
      age - the user's age
      department - the department the user belongs to
      active - whether the user is active
  • Method Details

    • name

      public String name()
      Returns:
      the user's display name
    • age

      public int age()
      Returns:
      the user's age
    • department

      public String department()
      Returns:
      the department the user belongs to
    • active

      public boolean active()
      Returns:
      whether the user is active