// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.sps.data;

public final class Tutor {
    
    private String name;
    private String email;
    private String[] skills;
    private TimeRange[] availability;
    private TutorSession[] scheduledSessions;

    public Tutor(String name, String email, String[] skills, TimeRange[] availability, TutorSession[] scheduledSessions) {
        this.name = name;
        this.email = email;
        this.skills = skills;
        this.availability = availability;
        this.scheduledSessions = scheduledSessions;
    }

    public String getName() {
        return this.name;
    }

    public String getEmail() {
        return this.email;
    }

    public String[] getSkills() {
        return this.skills;
    }

    public TimeRange[] getAvailability() {
        return this.availability;
    }

    public TutorSession[] getScheduledSessions() {
        return this.scheduledSessions;
    }

}

@@ -612,16 +612,122 @@
 .data;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0Aimport java.util.LinkedList;%0A%0A
 public f
@@ -1601,10 +1601,778 @@
 %0A    %7D%0A%0A
+    /** Deletes the given timeslot from the availability array. */%0A    public void deleteAvailabilityByTimeRange(TimeRange timeslot) %7B%0A        List%3CTimeRange%3E availabilityList = new LinkedList%3CTimeRange%3E(Arrays.asList(this.availability));%0A        availabilityList.remove(timeslot);%0A        this.availability = availabilityList.toArray(new TimeRange%5B0%5D);%0A    %7D%0A%0A    /** Adds the given Tutor Session to the scheduledSessions array. */%0A    public void addToScheduledSessions(TutorSession tutoringSession) %7B%0A        List%3CTutorSession%3E scheduledSessionsList = new LinkedList%3CTutorSession%3E(Arrays.asList(this.scheduledSessions));%0A        scheduledSessionsList.add(tutoringSession);%0A        this.scheduledSessions = scheduledSessionsList.toArray(new TutorSession%5B0%5D);%0A    %7D%0A%0A
 %7D%0A

Add deleteAvailabilityByTimeRange and addToScheduledSessions to the Tutor class.