# fromValue static method

DesignRole fromValue(

1. int value

)

Returns the DesignRole that corresponds to the given integer `value`.

    final role = DesignRole.fromValue(2);
    print(role == DesignRole.INFRASTRUCTURE); // true

Throws an IllegalArgumentException if the value does not map to any role.

## Implementation

    static DesignRole fromValue(int value) {
      return switch (value) {
        0 => APPLICATION,
        1 => SUPPORT,
        2 => INFRASTRUCTURE,
        _ => throw IllegalArgumentException('No DesignRole with value $value')
      };
    }