Parse a string into a Policy object.
Parse a string into a Policy object. Parsing rules are as follows:
- Case-insensitive names of singleton Policy objects (e.g. Never, Hourly,
Daily) are parsed into their corresponding objects.
- "Weekly(n)" is parsed into Weekly
objects with n
as the day-of-week
integer, as defined by the constants in java.util.Calendar.
- util-style data size strings (e.g. 3.megabytes, 1.gigabyte) are
parsed into StorageUnit
objects and used to produce MaxSize
policies.
See StorageUnit.parse(String)
for more details.