Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-249

[WON'T FIX] Validation failure for properties of type enum that have no default and are mandatory.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 0.2.0-incubating
    • 2.0.0-M3
    • Core
    • None

    Description

      ... such that this would be an error, showing up as a ValidationFailure in the MetaModelValidator:

      // {{ Gender (attribute)
      private PersonGenderType gender;

      @MemberOrder(sequence = "4")
      public PersonGenderType getGender()

      { return gender; }

      public void setGender(final PersonGenderType gender) { this.gender = gender; }

      // }}




      but this would be ok, because the programmer has provided an explicit default method:

      // {{ Gender (attribute)
      private PersonGenderType gender;

      @MemberOrder(sequence = "4")
      public PersonGenderType getGender() { return gender; }

      public void setGender(final PersonGenderType gender)

      { this.gender = gender; }

      public PersonGenderType defaultGender() { return PersonGenderType.UNKNOWN; }
      // }}




      and this would be ok, because the property is optional

      // {{ Gender (attribute)
      private PersonGenderType gender;

      @MemberOrder(sequence = "4")
      @Optional
      public PersonGenderType getGender() { return gender; }

      public void setGender(final PersonGenderType gender) { this.gender = gender; }

      // }}

      Attachments

        Activity

          People

            danhaywood Daniel Keir Haywood
            danhaywood Daniel Keir Haywood
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: