-
Notifications
You must be signed in to change notification settings - Fork 4
Feature facility factory #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @Override | ||
| Facility getForString(String value) { | ||
| Facility desiredKey | ||
| desiredKey = Facility.values().find {it.fullName.equals(value.trim())} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is Facility.values() returning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the enum values e.g. Facility.QBIC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> import life.qbic.datamodel.dtos.business.facilities.Facility
>
> Facility.values()
Result: [Core Facility for Medical Bioanalytics, Institute for Medical Genetics and Applied Genomics, Institute for Medical Microbiology and Hygiene, Quantitative Biology Center, Proteome Center Tübingen]
NOTE: toString() is called because of the print done by groovy
| Facility desiredKey | ||
| desiredKey = Facility.values().find {it.fullName.equals(value.trim())} | ||
| if (!desiredKey) { | ||
| throw new IllegalArgumentException("Invalid value '$value' for ${Facility.getSimpleName()}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is Facility.getSimpleName() returning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Facility
> import life.qbic.datamodel.dtos.business.facilities.Facility
>
> Facility.simpleName
Result: Facility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, i was irritated by the values call, but it is correct.
2.11.0 (2021-08-03) ---------------------------- **Added** * A new enumeration for facilities ``life.qbic.datamodel.dtos.business.facilities.Facility`` (<#244>) * New properties ``internalUnitPrice``, ``externalUnitPrice`` and ``serviceProvider`` for the ``life.qbic.datamodel.dtos.business.services.Product`` and its derivatives (<#245>) * New properties ``totalPrice`` and ``totalDiscountPrice`` for the ``life.qbic.datamodel.dtos.business.ProductItem`` and ``totalDiscountPrice`` for the ``life.qbic.datamodel.dtos.business.Offer`` * A ``life.qbic.datamodel.dtos.business.facilities.FacilityFactory`` to get the facility for a given string representation (<#247>) **Fixed** * ProjectSpace names are now validated (<#249>) **Dependencies** **Deprecated** * The ``unitPrice`` property in ``life.qbic.datamodel.dtos.business.services.Product``
This PR adds a facility factory