Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Ask to complete the class

    • 0
    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 449
    Answer it

    Hi,

    I was given a test to complete but unsure how I can use the apache commons in some methods. I have attached the file. Appreciate all your help.

     

    package interview;
    
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.List;
    
    import org.apache.commons.lang.StringUtils;
    import org.apache.commons.lang.builder.ToStringBuilder;
    import org.apache.commons.lang.builder.ToStringStyle;
    
    public class Schedule {
        private List<Date> byList = new ArrayList<Date>();
    
        private boolean everyDay;
    
        private boolean everyHour;
    
        private List<String> everyList = new ArrayList<String>();
    
        private String scheduleString;
    
        public Schedule(String scheduleString) {
        }
    
        public boolean hasBy() {
        }
    
        public List<Date> getByList() {
        }
    
        public boolean isEveryDay() {
        }
    
        public boolean isEveryHour() {
        }
    
        public List<String> getEveryList() {
        }
    }

     

 1 Answer(s)

  • Hi Alfredo, I did not get your reqirement completely. I understand, you want to use the following classes in your class -

    1. StringUtils
    2. ToStringBuilder
    3. ToStringStyle

    The standard Java libraries fail to provide enough methods for manipulation of its core classes. The classes you want to use from Apache Commons Lang provides them extra methods.

    The classes provide a host of helper utilities for the java.lang.String manipulation methods. Additionally Apache Commons Lang contains basic enhancements to java.util.Date, basic numerical methods, object reflection, concurrency, creation and serialization, System properties and a series of utilities dedicated to help with building methods, such as hashCode, toString and equals.

    Hope this would help you.

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: