Skip to content

Commit 991c7be

Browse files
committed
Add new line for description's doc
1 parent 9a91642 commit 991c7be

File tree

1 file changed

+84
-78
lines changed

1 file changed

+84
-78
lines changed
Lines changed: 84 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright 2011, 2013-2014 De Bortoli Wines Pty Limited (Australia)
3-
*
3+
*
44
* This file is part of OpenERPJavaAPI.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,83 +24,89 @@
2424

2525
/**
2626
* Provides the session context object that is used in calls to the server.
27-
* @author Pieter van der Merwe
2827
*
28+
* @author Pieter van der Merwe
2929
*/
30-
public class Context extends HashMap<String, Object>{
31-
32-
private static final long serialVersionUID = 1L;
33-
final static String ActiveTestTag = "active_test";
34-
final static String LangTag = "lang";
35-
final static String TimezoneTag = "tz";
36-
37-
38-
@Override
39-
public void putAll(Map<? extends String, ? extends Object> m) {
40-
// TODO Auto-generated method stub
41-
super.putAll(m);
42-
}
43-
44-
/**
45-
* Gets the active_test context property.
46-
* @return The active_test value or null if the property doesn't exist.
47-
*/
48-
public Boolean getActiveTest(){
49-
if (!this.containsKey(ActiveTestTag))
50-
return null;
51-
52-
return Boolean.parseBoolean(this.get(ActiveTestTag).toString());
53-
}
54-
55-
/**
56-
* Sets the active_test context value. If true, only active items are returned by default when calling the ReadObject item.
57-
* @param active_test
58-
*/
59-
public void setActiveTest(boolean active_test){
60-
this.remove(ActiveTestTag);
61-
this.put(ActiveTestTag, active_test);
62-
}
63-
64-
/**
65-
* Gets the 'lang' context value.
66-
* @return Language or null if the property doesn't exist.
67-
*/
68-
public String getLanguage() {
69-
if (!this.containsKey(LangTag))
70-
return null;
71-
72-
return this.get(LangTag).toString();
73-
}
74-
75-
/**
76-
* Sets the 'lang' context value.
77-
* @param lang Examples "en_US", "nl_NL"
78-
*/
79-
public void setLanguage(String lang) {
80-
this.remove(LangTag);
81-
this.put(LangTag, lang);
82-
}
83-
84-
/**
85-
* Gets the 'tz' context value.
86-
* @return Time zone string or null if the property doesn't exist
87-
*/
88-
public String getTimeZone() {
89-
if (!this.containsKey(TimezoneTag))
90-
return null;
91-
92-
if (this.get(TimezoneTag) instanceof Boolean && Boolean.getBoolean(this.get(TimezoneTag).toString()) == false)
93-
return null;
94-
95-
return this.get(TimezoneTag).toString();
96-
}
97-
98-
/**
99-
* Sets the 'tz' context flag.
100-
* @param tz Examples "Australia/Sydney", "Europe/Brussels"
101-
*/
102-
public void setTimeZone(String tz) {
103-
this.remove(TimezoneTag);
104-
this.put(TimezoneTag, tz);
105-
}
30+
public class Context extends HashMap<String, Object> {
31+
32+
private static final long serialVersionUID = 1L;
33+
final static String ActiveTestTag = "active_test";
34+
final static String LangTag = "lang";
35+
final static String TimezoneTag = "tz";
36+
37+
38+
@Override
39+
public void putAll(Map<? extends String, ? extends Object> m) {
40+
// TODO Auto-generated method stub
41+
super.putAll(m);
42+
}
43+
44+
/**
45+
* Gets the active_test context property.
46+
*
47+
* @return The active_test value or null if the property doesn't exist.
48+
*/
49+
public Boolean getActiveTest() {
50+
if (!this.containsKey(ActiveTestTag))
51+
return null;
52+
53+
return Boolean.parseBoolean(this.get(ActiveTestTag).toString());
54+
}
55+
56+
/**
57+
* Sets the active_test context value. If true, only active items are returned by default when calling the ReadObject item.
58+
*
59+
* @param active_test
60+
*/
61+
public void setActiveTest(boolean active_test) {
62+
this.remove(ActiveTestTag);
63+
this.put(ActiveTestTag, active_test);
64+
}
65+
66+
/**
67+
* Gets the 'lang' context value.
68+
*
69+
* @return Language or null if the property doesn't exist.
70+
*/
71+
public String getLanguage() {
72+
if (!this.containsKey(LangTag))
73+
return null;
74+
75+
return this.get(LangTag).toString();
76+
}
77+
78+
/**
79+
* Sets the 'lang' context value.
80+
*
81+
* @param lang Examples "en_US", "nl_NL"
82+
*/
83+
public void setLanguage(String lang) {
84+
this.remove(LangTag);
85+
this.put(LangTag, lang);
86+
}
87+
88+
/**
89+
* Gets the 'tz' context value.
90+
*
91+
* @return Time zone string or null if the property doesn't exist
92+
*/
93+
public String getTimeZone() {
94+
if (!this.containsKey(TimezoneTag))
95+
return null;
96+
97+
if (this.get(TimezoneTag) instanceof Boolean && Boolean.getBoolean(this.get(TimezoneTag).toString()) == false)
98+
return null;
99+
100+
return this.get(TimezoneTag).toString();
101+
}
102+
103+
/**
104+
* Sets the 'tz' context flag.
105+
*
106+
* @param tz Examples "Australia/Sydney", "Europe/Brussels"
107+
*/
108+
public void setTimeZone(String tz) {
109+
this.remove(TimezoneTag);
110+
this.put(TimezoneTag, tz);
111+
}
106112
}

0 commit comments

Comments
 (0)