Skip to content

Commit

Permalink
Implement fetch of contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
douglm committed Jun 22, 2018
1 parent db929c0 commit cf94c92
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/* ********************************************************************
Licensed to Jasig under one or more contributor license
agreements. See the NOTICE file distributed with this work
for additional information regarding copyright ownership.
Jasig licenses this file to you 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:
http://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 org.bedework.calfacade.responses;

import org.bedework.calfacade.BwContact;
import org.bedework.util.misc.ToString;

import java.util.Collection;

/** Container for fetching contacts.
*
* @author Mike Douglass douglm
*/
public class ContactsResponse extends EventPropertiesResponse {
private Collection<BwContact> contacts;

/**
*
* @param val collection of contacts
*/
public void setContacts(final Collection<BwContact> val) {
contacts = val;
}

/**
* @return collection of contacts
*/
public Collection<BwContact> getContacts() {
return contacts;
}

@Override
public void toStringSegment(final ToString ts) {
super.toStringSegment(ts);

ts.append("contacts", getContacts());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/* ********************************************************************
Licensed to Jasig under one or more contributor license
agreements. See the NOTICE file distributed with this work
for additional information regarding copyright ownership.
Jasig licenses this file to you 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:
http://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 org.bedework.calfacade.responses;

import org.bedework.util.misc.ToString;

import java.util.List;

/** Container for fetching event properties.
*
* @author Mike Douglass douglm
*/
public class EventPropertiesResponse extends Response {
private List<String> preferred;

/**
* @param val list of hrefs
*/
public void setPreferred(final List<String> val) {
preferred = val;
}

/**
* @return list of hrefs
*/
public List<String> getPreferred() {
return preferred;
}

@Override
public void toStringSegment(final ToString ts) {
super.toStringSegment(ts);

ts.append("preferred", getPreferred());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@
import org.bedework.util.misc.ToString;

import java.util.Collection;
import java.util.List;

/** Container for fetching locations.
*
* @author Mike Douglass douglm - rpi.edu
*/
public class LocationsResponse extends Response {
public class LocationsResponse extends EventPropertiesResponse {
private Collection<BwLocation> locations;
private List<String> preferred;

/**
*
Expand All @@ -47,25 +45,10 @@ public Collection<BwLocation> getLocations() {
return locations;
}

/**
* @param val list of hrefs
*/
public void setPreferred(final List<String> val) {
preferred = val;
}

/**
* @return list of hrefs
*/
public List<String> getPreferred() {
return preferred;
}

@Override
public void toStringSegment(final ToString ts) {
super.toStringSegment(ts);

ts.append("locations", getLocations())
.append("preferred", getPreferred());
ts.append("locations", getLocations());
}
}

0 comments on commit cf94c92

Please sign in to comment.