com.bluenimble.platform.http.response.impls.HttpResponseImpl Maven / Gradle / Ivy
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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 com.bluenimble.platform.http.response.impls;
import com.bluenimble.platform.http.impls.HttpMessageImpl;
import com.bluenimble.platform.http.response.HttpResponse;
public class HttpResponseImpl extends HttpMessageImpl implements HttpResponse {
private static final long serialVersionUID = 9027275355235686148L;
protected String id;
protected int status;
public HttpResponseImpl (String id) {
this.id = id;
}
@Override
public String getId () {
return id;
}
@Override
public int getStatus () {
return status;
}
public void setStatus(int status) {
this.status = status;
}
@Override
public String toString () {
StringBuilder sb = new StringBuilder ();
sb.append ("").append (" ").append (String.valueOf (status)).append ("\n");
sb.append (super.toString ());
sb.append ("\n").append ("\n").append (" ");
if (getBody () != null) {
sb.append ("#PARTS ").append (getBody ().count ()).append ("\n");
}
String s = sb.toString ();
sb.setLength (0);
sb = null;
return s;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy